diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-10-09 09:02:11 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-10-09 09:02:11 +0000 |
commit | 498a429a41bc47fc7e3980926901cc60863afe9a (patch) | |
tree | b72a844dd383e35a87562d6278134737a8f660ee /test/functional | |
parent | 3a3fe668c77cdb3266bfd1b067a30a1c09713763 (diff) | |
download | redmine-498a429a41bc47fc7e3980926901cc60863afe9a.tar.gz redmine-498a429a41bc47fc7e3980926901cc60863afe9a.zip |
Display totals for each group on grouped queries (#1561).
git-svn-id: http://svn.redmine.org/redmine/trunk@14665 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/issues_controller_test.rb | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 18c82aef1..158ba4316 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -953,10 +953,32 @@ class IssuesControllerTest < ActionController::TestCase get :index, :t => %w(estimated_hours) assert_response :success assert_select '.query-totals' - assert_select '.total-for-estimated-hours span.value', :text => '6.6' + assert_select '.total-for-estimated-hours span.value', :text => '6.60' assert_select 'input[type=checkbox][name=?][value=estimated_hours][checked=checked]', 't[]' end + def test_index_with_grouped_query_and_estimated_hours_total + Issue.delete_all + Issue.generate!(:estimated_hours => 5.5, :category_id => 1) + Issue.generate!(:estimated_hours => 2.3, :category_id => 1) + Issue.generate!(:estimated_hours => 1.1, :category_id => 2) + Issue.generate!(:estimated_hours => 4.6) + + get :index, :t => %w(estimated_hours), :group_by => 'category' + assert_response :success + assert_select '.query-totals' + assert_select '.query-totals .total-for-estimated-hours span.value', :text => '13.50' + assert_select 'tr.group', :text => /Printing/ do + assert_select '.total-for-estimated-hours span.value', :text => '7.80' + end + assert_select 'tr.group', :text => /Recipes/ do + assert_select '.total-for-estimated-hours span.value', :text => '1.10' + end + assert_select 'tr.group', :text => /blank/ do + assert_select '.total-for-estimated-hours span.value', :text => '4.60' + end + end + def test_index_with_int_custom_field_total field = IssueCustomField.generate!(:field_format => 'int', :is_for_all => true) CustomValue.create!(:customized => Issue.find(1), :custom_field => field, :value => '2') |