diff options
Diffstat (limited to 'activesupport/test/json/decoding_test.rb')
-rw-r--r-- | activesupport/test/json/decoding_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/test/json/decoding_test.rb b/activesupport/test/json/decoding_test.rb index d1454902e5..a2d1d0dc39 100644 --- a/activesupport/test/json/decoding_test.rb +++ b/activesupport/test/json/decoding_test.rb @@ -62,21 +62,25 @@ class TestJSONDecoding < ActiveSupport::TestCase backends.each do |backend| TESTS.each do |json, expected| test "json decodes #{json} with the #{backend} backend" do + prev = ActiveSupport.parse_json_times ActiveSupport.parse_json_times = true silence_warnings do ActiveSupport::JSON.with_backend backend do assert_equal expected, ActiveSupport::JSON.decode(json) end end + ActiveSupport.parse_json_times = prev end end test "json decodes time json with time parsing disabled with the #{backend} backend" do + prev = ActiveSupport.parse_json_times ActiveSupport.parse_json_times = false expected = {"a" => "2007-01-01 01:12:34 Z"} ActiveSupport::JSON.with_backend backend do assert_equal expected, ActiveSupport::JSON.decode(%({"a": "2007-01-01 01:12:34 Z"})) end + ActiveSupport.parse_json_times = prev end end |