Feature #40706 » link_to_activity.patch
| app/helpers/projects_queries_helper.rb | ||
|---|---|---|
| 40 | 40 |
get_project_status_label[column.value_object(item)] |
| 41 | 41 |
when :parent_id |
| 42 | 42 |
link_to_project(item.parent) unless item.parent.nil? |
| 43 |
when :last_activity_date |
|
| 44 |
formatted_value = super |
|
| 45 |
if value.present? && formatted_value.present? |
|
| 46 |
link_to( |
|
| 47 |
formatted_value, |
|
| 48 |
project_activity_path(item, :from => User.current.time_to_date(value)) |
|
| 49 |
) |
|
| 50 |
else |
|
| 51 |
formatted_value |
|
| 52 |
end |
|
| 43 | 53 |
else |
| 44 | 54 |
super |
| 45 | 55 |
end |
| test/functional/projects_controller_test.rb | ||
|---|---|---|
| 260 | 260 |
assert_response :success |
| 261 | 261 |
end |
| 262 | 262 |
assert_equal ['Name', 'Description', 'Last activity'], columns_in_list |
| 263 |
assert_select 'tr#project-1 td.last_activity_date', :text => format_time(Journal.find(3).created_on) |
|
| 263 |
activity_time = Journal.find(3).created_on |
|
| 264 |
assert_select "tr#project-1 td.last_activity_date a[href=?]", |
|
| 265 |
project_activity_path(Project.find(1), :from => User.current.time_to_date(activity_time)), |
|
| 266 |
:text => format_time(activity_time) |
|
| 264 | 267 |
assert_select 'tr#project-4 td.last_activity_date', :text => '' |
| 265 | 268 |
end |
| 266 | 269 | |
- « Previous
- 1
- 2
- 3
- Next »