diff options
author | Ryan Glover <ersatzryan@gmail.com> | 2013-11-07 10:35:49 -0500 |
---|---|---|
committer | Ryan Glover <ersatzryan@gmail.com> | 2013-11-07 10:43:51 -0500 |
commit | a64d4e85e311edfcea79c777c6a184dc408c2f57 (patch) | |
tree | 5247af7249feb18faff8cbe04c090fca910848b6 /activesupport/test/json | |
parent | 0fca7d67d4b748584e589bea69db1988b3138cb0 (diff) | |
download | rails-a64d4e85e311edfcea79c777c6a184dc408c2f57.tar.gz rails-a64d4e85e311edfcea79c777c6a184dc408c2f57.tar.bz2 rails-a64d4e85e311edfcea79c777c6a184dc408c2f57.zip |
Standardize all JSON encoded times to use 3 decimal fractional seconds
Diffstat (limited to 'activesupport/test/json')
-rw-r--r-- | activesupport/test/json/encoding_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb index 11a2ca9d90..856ca75cbc 100644 --- a/activesupport/test/json/encoding_test.rb +++ b/activesupport/test/json/encoding_test.rb @@ -71,8 +71,8 @@ class TestJSONEncoding < ActiveSupport::TestCase DateTimeTests = [[ DateTime.civil(2005,2,1,15,15,10), %("2005/02/01 15:15:10 +0000") ]] StandardDateTests = [[ Date.new(2005,2,1), %("2005-02-01") ]] - StandardTimeTests = [[ Time.utc(2005,2,1,15,15,10), %("2005-02-01T15:15:10Z") ]] - StandardDateTimeTests = [[ DateTime.civil(2005,2,1,15,15,10), %("2005-02-01T15:15:10+00:00") ]] + StandardTimeTests = [[ Time.utc(2005,2,1,15,15,10), %("2005-02-01T15:15:10.000Z") ]] + StandardDateTimeTests = [[ DateTime.civil(2005,2,1,15,15,10), %("2005-02-01T15:15:10.000+00:00") ]] StandardStringTests = [[ 'this is the <string>', %("this is the <string>")]] def sorted_json(json) @@ -184,7 +184,7 @@ class TestJSONEncoding < ActiveSupport::TestCase prev = ActiveSupport.use_standard_json_time_format ActiveSupport.use_standard_json_time_format = true with_env_tz 'US/Eastern' do - assert_equal %("2005-02-01T15:15:10-05:00"), ActiveSupport::JSON.encode(Time.local(2005,2,1,15,15,10)) + assert_equal %("2005-02-01T15:15:10.000-05:00"), ActiveSupport::JSON.encode(Time.local(2005,2,1,15,15,10)) end ensure ActiveSupport.use_standard_json_time_format = prev |