aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/time_with_zone_test.rb
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2014-01-31 17:13:12 +0000
committerAndrew White <andyw@pixeltrix.co.uk>2014-01-31 17:13:12 +0000
commit63f8fabe4939ad59d597dfea441002ef5b16d2f4 (patch)
tree3f4cd24e7c9d24649338396df1c67902d5a66037 /activesupport/test/core_ext/time_with_zone_test.rb
parentf484df79f26bca7e952f907878074eddbf72656d (diff)
downloadrails-63f8fabe4939ad59d597dfea441002ef5b16d2f4.tar.gz
rails-63f8fabe4939ad59d597dfea441002ef5b16d2f4.tar.bz2
rails-63f8fabe4939ad59d597dfea441002ef5b16d2f4.zip
Maintain the current timezone in wrap_with_time_zone
Extend the solution from the fix for #12163 to the general case where `Time` methods are wrapped with a time zone. Fixes #12596.
Diffstat (limited to 'activesupport/test/core_ext/time_with_zone_test.rb')
-rw-r--r--activesupport/test/core_ext/time_with_zone_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/time_with_zone_test.rb b/activesupport/test/core_ext/time_with_zone_test.rb
index 8e25f1e2f2..7fe4d4a6b2 100644
--- a/activesupport/test/core_ext/time_with_zone_test.rb
+++ b/activesupport/test/core_ext/time_with_zone_test.rb
@@ -500,6 +500,11 @@ class TimeWithZoneTest < ActiveSupport::TestCase
assert_equal twz, twz.change(:min => 0)
end
+ def test_round_at_dst_boundary
+ twz = ActiveSupport::TimeWithZone.new(Time.at(1319936400).getutc, ActiveSupport::TimeZone['Madrid'])
+ assert_equal twz, twz.round
+ end
+
def test_advance
assert_equal "Fri, 31 Dec 1999 19:00:00 EST -05:00", @twz.inspect
assert_equal "Mon, 31 Dec 2001 19:00:00 EST -05:00", @twz.advance(:years => 2).inspect