diff options
-rw-r--r-- | test/functional/issues_controller_test.rb | 4 | ||||
-rw-r--r-- | test/test_helper.rb | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 92440f573..872db7a1d 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -978,13 +978,13 @@ class IssuesControllerTest < Redmine::ControllerTest get :index, :params => {:sort => "spent_hours:desc", :c => ['subject','spent_hours']} assert_response :success - assert_equal [4.0, 3.0, 0.0], issues_in_list.map(&:spent_hours)[0..2] + assert_equal ['4.00', '3.00', '0.00'], columns_values_in_list('spent_hours')[0..2] Project.find(3).disable_module!(:time_tracking) get :index, :params => {:sort => "spent_hours:desc", :c => ['subject','spent_hours']} assert_response :success - assert_equal [3.0, 0.0, 0.0], issues_in_list.map(&:spent_hours)[0..2] + assert_equal ['3.00', '0.00', '0.00'], columns_values_in_list('spent_hours')[0..2] end def test_index_sort_by_total_spent_hours diff --git a/test/test_helper.rb b/test/test_helper.rb index 6dcdb7a7c..796daf268 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -312,7 +312,12 @@ module Redmine def columns_in_list css_select('table.list thead th:not(.checkbox)').map(&:text).select(&:present?) end - + + # Returns the values that are displayed in tds with the given css class + def columns_values_in_list(css_class) + css_select("table.list tbody td.#{css_class}").map(&:text) + end + # Verifies that the query filters match the expected filters def assert_query_filters(expected_filters) response.body =~ /initFilters\(\);\s*((addFilter\(.+\);\s*)*)/ |