show account and project name in task request details for BIG admin #9
@@ -7,8 +7,8 @@ module DescriptionListHelper
|
|||||||
safe_join(tags)
|
safe_join(tags)
|
||||||
end
|
end
|
||||||
|
|
||||||
def description_list_pair_for(record, attribute, append: nil)
|
def description_list_pair_for(record, attribute, append: nil, custom_label: nil)
|
||||||
term = translation_for(record, attribute)
|
term = custom_label.nil? ? translation_for(record, attribute) : custom_label
|
||||||
definition = record.send(attribute)
|
definition = record.send(attribute)
|
||||||
|
|
||||||
description_list_pair(term, definition, append: append)
|
description_list_pair(term, definition, append: append)
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<dl>
|
<dl>
|
||||||
|
<%= description_list_pair_for @task_request.project.account, :name, custom_label: "Account Name", append: ":" %>
|
||||||
|
<%= description_list_pair_for @task_request.project, :name, custom_label: "Project Name", append: ":" %>
|
||||||
<%= description_list_pair_for @task_request, :description, append: ":" %>
|
<%= description_list_pair_for @task_request, :description, append: ":" %>
|
||||||
<%= description_list_pair_for @task_request, :created_at, append: ":" %>
|
<%= description_list_pair_for @task_request, :created_at, append: ":" %>
|
||||||
<%= description_list_pair_for @task_request, :deadline, append: ":" %>
|
<%= description_list_pair_for @task_request, :deadline, append: ":" %>
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ feature "Admin managing task requests" do
|
|||||||
click_link 'View'
|
click_link 'View'
|
||||||
switch_to_window(windows.last)
|
switch_to_window(windows.last)
|
||||||
|
|
||||||
|
expect(page).to have_content 'Account Name'
|
||||||
|
expect(page).to have_content task_request.project.account.name
|
||||||
|
|
||||||
|
expect(page).to have_content 'Project Name'
|
||||||
|
expect(page).to have_content task_request.project.name
|
||||||
|
|
||||||
expect(page).to have_content 'Description'
|
expect(page).to have_content 'Description'
|
||||||
expect(page).to have_content task_request.description
|
expect(page).to have_content task_request.description
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user