Feature #35797 ยป 0001-Don-t-display-0.00-in-the-Spent-time-and-Total-spent.patch
| app/helpers/queries_helper.rb | ||
|---|---|---|
|
when :hours, :estimated_hours, :total_estimated_hours, :estimated_remaining_hours
|
||
|
format_hours(value)
|
||
|
when :spent_hours
|
||
|
link_to_if(value > 0, format_hours(value), project_time_entries_path(item.project, :issue_id => "#{item.id}"))
|
||
|
value > 0 ? link_to(format_hours(value), project_time_entries_path(item.project, :issue_id => "#{item.id}")) : ''
|
||
|
when :total_spent_hours
|
||
|
link_to_if(value > 0, format_hours(value), project_time_entries_path(item.project, :issue_id => "~#{item.id}"))
|
||
|
value > 0 ? link_to(format_hours(value), project_time_entries_path(item.project, :issue_id => "~#{item.id}")) : ''
|
||
|
when :attachments
|
||
|
value.to_a.map {|a| format_object(a)}.join(" ").html_safe
|
||
|
when :watcher_users
|
||
| test/functional/issues_controller_test.rb | ||
|---|---|---|
|
}
|
||
|
)
|
||
|
assert_response :success
|
||
|
assert_equal ['4:00', '3:00', '0:00'], columns_values_in_list('spent_hours').first(3)
|
||
|
assert_equal ['4:00', '3:00', ''], columns_values_in_list('spent_hours').first(3)
|
||
|
Project.find(3).disable_module!(:time_tracking)
|
||
|
get(
|
||
|
:index,
|
||
| ... | ... | |
|
}
|
||
|
)
|
||
|
assert_response :success
|
||
|
assert_equal ['3:00', '0:00', '0:00'], columns_values_in_list('spent_hours').first(3)
|
||
|
assert_equal ['3:00', '', ''], columns_values_in_list('spent_hours').first(3)
|
||
|
end
|
||
|
def test_index_sort_by_total_spent_hours
|
||
| ... | ... | |
|
}
|
||
|
)
|
||
|
assert_select 'table.issues tr#issue-3 td.spent_hours', :text => '1:00'
|
||
|
assert_select 'table.issues tr#issue-2 td.spent_hours', :text => ''
|
||
|
end
|
||
|
def test_index_with_total_spent_hours_column
|
||
| ... | ... | |
|
}
|
||
|
)
|
||
|
assert_select 'table.issues tr#issue-3 td.total_spent_hours', :text => '1:00'
|
||
|
assert_select 'table.issues tr#issue-2 td.total_spent_hours', :text => ''
|
||
|
end
|
||
|
def test_index_with_total_estimated_hours_column
|
||