summaryrefslogtreecommitdiffstats
path: root/test/helpers
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-06-09 03:43:43 +0000
committerGo MAEDA <maeda@farend.jp>2019-06-09 03:43:43 +0000
commit37b7578f0f5601ae7ef0ded29b12422ad00e9152 (patch)
tree2799ba8d4c4838937ba5c0066170ae91e1e7c33b /test/helpers
parent299f7a40b79e4e3c37711205f70fd847b4c7cde2 (diff)
downloadredmine-37b7578f0f5601ae7ef0ded29b12422ad00e9152.tar.gz
redmine-37b7578f0f5601ae7ef0ded29b12422ad00e9152.zip
Fix that test_issue_due_date_details fails depending on time zone (#31499).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@18238 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/helpers')
-rw-r--r--test/helpers/issues_helper_test.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/helpers/issues_helper_test.rb b/test/helpers/issues_helper_test.rb
index 076b51b7f..15dcae5bb 100644
--- a/test/helpers/issues_helper_test.rb
+++ b/test/helpers/issues_helper_test.rb
@@ -333,14 +333,16 @@ class IssuesHelperTest < Redmine::HelperTest
end
def test_issue_due_date_details
- travel_to DateTime.parse('2019-06-01') do
+ travel_to Time.parse('2019-06-01 23:00:00 UTC') do
+ User.current = User.first
+ User.current.pref.update_attribute :time_zone, 'UTC'
issue = Issue.generate!
# due date is not set
assert_nil issue_due_date_details(issue)
# due date is set
- issue.due_date = 5.days.from_now
+ issue.due_date = User.current.today + 5
issue.save!
assert_equal '06/06/2019 (Due in 5 days)', issue_due_date_details(issue)