summaryrefslogtreecommitdiffstats
path: root/test/unit/time_entry_query_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-03-03 17:17:50 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-03-03 17:17:50 +0000
commit3faa3693d16207a0398adb389f244c6de396e271 (patch)
tree8cb96c0b58bfcc9e5e88fb3c4057418a63e81d98 /test/unit/time_entry_query_test.rb
parentddef0ad7c164c8eee4a9832fe8fbce1fb538745a (diff)
downloadredmine-3faa3693d16207a0398adb389f244c6de396e271.tar.gz
redmine-3faa3693d16207a0398adb389f244c6de396e271.zip
Test failures.
git-svn-id: http://svn.redmine.org/redmine/trunk@16359 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/time_entry_query_test.rb')
-rw-r--r--test/unit/time_entry_query_test.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/unit/time_entry_query_test.rb b/test/unit/time_entry_query_test.rb
index 317f037d0..f60091cb9 100644
--- a/test/unit/time_entry_query_test.rb
+++ b/test/unit/time_entry_query_test.rb
@@ -68,13 +68,15 @@ class TimeEntryQueryTest < ActiveSupport::TestCase
TimeEntry.generate!(:activity => override, :hours => 2.0)
TimeEntry.generate!(:activity => other, :hours => 4.0)
- query = TimeEntryQuery.new(:name => '_')
- query.add_filter('activity_id', '=', [system.id.to_s])
- assert_equal 3.0, query.results_scope.sum(:hours)
-
- query = TimeEntryQuery.new(:name => '_')
- query.add_filter('activity_id', '!', [system.id.to_s])
- assert_equal 4.0, query.results_scope.sum(:hours)
+ with_current_user User.find(2) do
+ query = TimeEntryQuery.new(:name => '_')
+ query.add_filter('activity_id', '=', [system.id.to_s])
+ assert_equal 3.0, query.results_scope.sum(:hours)
+
+ query = TimeEntryQuery.new(:name => '_')
+ query.add_filter('activity_id', '!', [system.id.to_s])
+ assert_equal 4.0, query.results_scope.sum(:hours)
+ end
end
def test_project_query_should_include_project_issue_custom_fields_only_as_filters