summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-10-09 09:30:14 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-10-09 09:30:14 +0000
commit9c7832d82230d96e8599df3574dc9d27811c23d8 (patch)
treefbf883f44592e926ff39b289f48cd3fa6cd28146 /test/unit
parenteee65c8ba82216fb5a7501b7c1cf37896c5f2f23 (diff)
downloadredmine-9c7832d82230d96e8599df3574dc9d27811c23d8.tar.gz
redmine-9c7832d82230d96e8599df3574dc9d27811c23d8.zip
Workaround for spent time grouped by project (#1561).
git-svn-id: http://svn.redmine.org/redmine/trunk@14667 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/query_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb
index 679fc772d..c76ad7265 100644
--- a/test/unit/query_test.rb
+++ b/test/unit/query_test.rb
@@ -1219,6 +1219,20 @@ class QueryTest < ActiveSupport::TestCase
)
end
+ def test_total_by_project_group_for_spent_hours
+ TimeEntry.delete_all
+ TimeEntry.generate!(:hours => 5.5, :issue_id => 1)
+ TimeEntry.generate!(:hours => 1.1, :issue_id => 2)
+ Issue.where(:id => 1).update_all(:assigned_to_id => 2)
+ Issue.where(:id => 2).update_all(:assigned_to_id => 3)
+
+ q = IssueQuery.new(:group_by => 'project')
+ assert_equal(
+ {Project.find(1) => 6.6},
+ q.total_by_group_for(:spent_hours)
+ )
+ end
+
def test_total_for_int_custom_field
field = IssueCustomField.generate!(:field_format => 'int', :is_for_all => true)
CustomValue.create!(:customized => Issue.find(1), :custom_field => field, :value => '2')