diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2013-10-30 10:58:20 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2013-10-30 10:58:20 -0700 |
commit | 9e4efed6e0c3fde2944b01e558a61d5b7a188d21 (patch) | |
tree | 2df3256b8da7efc52f4da3e13300562cdd9abfcc /activesupport/test/json | |
parent | dae66a0c9733a7fd2ba4357e24b03b386be3e38f (diff) | |
parent | 1fb79691548cd370e83625045a0a445c97fa0dea (diff) | |
download | rails-9e4efed6e0c3fde2944b01e558a61d5b7a188d21.tar.gz rails-9e4efed6e0c3fde2944b01e558a61d5b7a188d21.tar.bz2 rails-9e4efed6e0c3fde2944b01e558a61d5b7a188d21.zip |
Merge pull request #12214 from chancancode/json_decode_does_not_take_options
Raise an error when AS::JSON.decode is called with options
Diffstat (limited to 'activesupport/test/json')
-rw-r--r-- | activesupport/test/json/decoding_test.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/activesupport/test/json/decoding_test.rb b/activesupport/test/json/decoding_test.rb index e9780b36e4..07d7e530ca 100644 --- a/activesupport/test/json/decoding_test.rb +++ b/activesupport/test/json/decoding_test.rb @@ -98,10 +98,8 @@ class TestJSONDecoding < ActiveSupport::TestCase assert_raise(ActiveSupport::JSON.parse_error) { ActiveSupport::JSON.decode(%()) } end - def test_cannot_force_json_unmarshalling - encodeded = %q({"json_class":"TestJSONDecoding::Foo"}) - decodeded = {"json_class"=>"TestJSONDecoding::Foo"} - assert_equal decodeded, ActiveSupport::JSON.decode(encodeded, create_additions: true) + def test_cannot_pass_unsupported_options + assert_raise(ArgumentError) { ActiveSupport::JSON.decode("", create_additions: true) } end end |