From 2ede29186ce3eda0f31eda4c8492d517496abd5c Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Wed, 9 Aug 2017 06:38:04 +0000 Subject: [PATCH] Merged r16938 from trunk to 3.3-stable (#22320) try IssueTest#test_overdue failing on CI server at Japanese daytime. git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@16952 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/issue_test.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index 1b26ace14..dfed9b111 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -2242,11 +2242,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 -- 2.39.5