diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-03-03 17:56:51 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-03-03 17:56:51 -0300 |
commit | 33ae6344834fdf71b93e0b6db899b58e017a7655 (patch) | |
tree | 90fc2acbd349f3d637ea70ade13eaf6bb84a03a1 /activesupport/test/core_ext | |
parent | 8a74190121345083ebef1d81bf0c0129b40b33e9 (diff) | |
parent | 2cc2fa3633edd96773023c6b09d07c7b9d9b841d (diff) | |
download | rails-33ae6344834fdf71b93e0b6db899b58e017a7655.tar.gz rails-33ae6344834fdf71b93e0b6db899b58e017a7655.tar.bz2 rails-33ae6344834fdf71b93e0b6db899b58e017a7655.zip |
Merge pull request #18777 from yasyf/issue_15209
Take DST into account when locating TimeZone from Numeric
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/time_with_zone_test.rb | 7 |
1 files changed, 7 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 92c233d567..0f5522b712 100644 --- a/activesupport/test/core_ext/time_with_zone_test.rb +++ b/activesupport/test/core_ext/time_with_zone_test.rb @@ -867,6 +867,13 @@ class TimeWithZoneMethodsForTimeAndDateTimeTest < ActiveSupport::TestCase end end + def test_in_time_zone_with_dst + travel_to(Time.utc(2014, 5, 20, 4, 59, 59)) + time = Time.now.in_time_zone(-4) + assert_equal (-4*3600), time.time_zone.utc_total_offset + travel_back + end + def test_in_time_zone_with_invalid_argument assert_raise(ArgumentError) { @t.in_time_zone("No such timezone exists") } assert_raise(ArgumentError) { @dt.in_time_zone("No such timezone exists") } |