]> source.dussan.org Git - redmine.git/commitdiff
Merged r16938 from trunk to 3.4-stable (#22320)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 9 Aug 2017 06:36:29 +0000 (06:36 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 9 Aug 2017 06:36:29 +0000 (06:36 +0000)
try IssueTest#test_overdue failing on CI server at Japanese daytime.

git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@16951 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/issue_test.rb

index 39d9de879499ee47eaadc393740ff6ffd7f94e59..2902c427fb4c7b08f53e9bb2e8ab745080fe5c03 100644 (file)
@@ -2279,11 +2279,13 @@ class IssueTest < ActiveSupport::TestCase
   end
 
   def test_overdue
-    assert Issue.new(:due_date => 1.day.ago.to_date).overdue?
-    assert !Issue.new(:due_date => Date.today).overdue?
-    assert !Issue.new(:due_date => 1.day.from_now.to_date).overdue?
+    User.current = nil
+    today = User.current.today
+    assert  Issue.new(:due_date => (today - 1.day).to_date).overdue?
+    assert !Issue.new(:due_date => today).overdue?
+    assert !Issue.new(:due_date => (today + 1.day).to_date).overdue?
     assert !Issue.new(:due_date => nil).overdue?
-    assert !Issue.new(:due_date => 1.day.ago.to_date,
+    assert !Issue.new(:due_date => (today - 1.day).to_date,
                       :status => IssueStatus.where(:is_closed => true).first
                       ).overdue?
   end