From a59461ad3df5a51a30cbecb139a53ffc7afa4856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Barri=C3=A9?= Date: Fri, 8 Dec 2023 14:00:51 +0100 Subject: [PATCH] Fix timezone test The test was created when DST was on, and now we're not, so this causes a one-hour difference in the utc_offset. We could add some logic around this, but if we reuse the date and format it instead of using a literal, this should ensure they're both in DST or not. --- test/helpers/maintenance_tasks/tasks_helper_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/helpers/maintenance_tasks/tasks_helper_test.rb b/test/helpers/maintenance_tasks/tasks_helper_test.rb index d72e66c54..88d24723f 100644 --- a/test/helpers/maintenance_tasks/tasks_helper_test.rb +++ b/test/helpers/maintenance_tasks/tasks_helper_test.rb @@ -128,7 +128,7 @@ class TasksHelperTest < ActionView::TestCase # Time.zone_default Time.use_zone(now.utc_offset + 2.hour * sign) do # a timezone that is not the system timezone with_zone_default(Time.find_zone!(now.utc_offset + 1.hour * sign)) do # another non-system timezone - value = ActiveModel::Type::DateTime.new.cast("2023-06-01T12:00:00") # a local ISO8601 time (no timezone) + value = ActiveModel::Type::DateTime.new.cast(now.strftime("%FT%T")) # a local ISO8601 time (no timezone) refute_predicate(value, :utc?) assert_equal(now.utc_offset, value.utc_offset) # uses system time zone end