summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2017-08-09 06:36:29 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2017-08-09 06:36:29 +0000
commitec8d5892467a476e980016700510f87477b3e123 (patch)
treeddabc8e9b5553eeb1ec1ff7a1384e3c901096eff
parent5192f0a755672d12d9a257fada7d8d7bd056e60f (diff)
downloadredmine-ec8d5892467a476e980016700510f87477b3e123.tar.gz
redmine-ec8d5892467a476e980016700510f87477b3e123.zip
Merged r16938 from trunk to 3.4-stable (#22320)
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
-rw-r--r--test/unit/issue_test.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index 39d9de879..2902c427f 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -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