diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-01-05 22:59:11 -0200 |
---|---|---|
committer | Rafael França <rafaelmfranca@gmail.com> | 2016-01-05 22:59:11 -0200 |
commit | 11e7c605a4db96233d35e1bc0eb366612ae44a98 (patch) | |
tree | f73e4ad8ba5ba001a237e15673c8311cdbbcbbb3 /activemodel/test | |
parent | 91ceac3728e1fc0ea3bf757c592939758defd27b (diff) | |
parent | 0a0ffb64d88949db29c235637eeadeea3eeaf292 (diff) | |
download | rails-11e7c605a4db96233d35e1bc0eb366612ae44a98.tar.gz rails-11e7c605a4db96233d35e1bc0eb366612ae44a98.tar.bz2 rails-11e7c605a4db96233d35e1bc0eb366612ae44a98.zip |
Merge pull request #20544 from Envek/fix_utc_offset_for_time_attributes
Take UTC offset into account when assigning string value to time attributes.
Diffstat (limited to 'activemodel/test')
-rw-r--r-- | activemodel/test/cases/types_test.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/activemodel/test/cases/types_test.rb b/activemodel/test/cases/types_test.rb index f937208580..558c56f157 100644 --- a/activemodel/test/cases/types_test.rb +++ b/activemodel/test/cases/types_test.rb @@ -64,6 +64,9 @@ module ActiveModel time_string = Time.now.utc.strftime("%T") assert_equal time_string, type.cast(time_string).strftime("%T") + + assert_equal ::Time.utc(2000, 1, 1, 16, 45, 54), type.cast('2015-06-13T19:45:54+03:00') + assert_equal ::Time.utc(1999, 12, 31, 21, 7, 8), type.cast('06:07:08+09:00') end def test_type_cast_datetime_and_timestamp |