diff options
Diffstat (limited to 'activesupport/test/time_zone_test.rb')
-rw-r--r-- | activesupport/test/time_zone_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activesupport/test/time_zone_test.rb b/activesupport/test/time_zone_test.rb index cd79efbe8c..48bcfa6929 100644 --- a/activesupport/test/time_zone_test.rb +++ b/activesupport/test/time_zone_test.rb @@ -124,6 +124,20 @@ class TimeZoneTest < ActiveSupport::TestCase travel_back end + def test_travel_to_a_date + with_env_tz do + Time.use_zone('Hawaii') do + date = Date.new(2014, 2, 18) + time = date.midnight + + travel_to date + + assert_equal date, Date.current + assert_equal time, Time.current + end + end + end + def test_local time = ActiveSupport::TimeZone["Hawaii"].local(2007, 2, 5, 15, 30, 45) assert_equal Time.utc(2007, 2, 5, 15, 30, 45), time.time |