aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/json
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2013-11-26 14:05:12 -0800
committerGodfrey Chan <godfreykfc@gmail.com>2013-12-02 17:22:57 -0800
commitfadc02b7322c97f10d34fc04c147f3585eda1272 (patch)
tree759cbc41156b95be670d4bb801f4b4f7c64175ed /activesupport/test/json
parent23aa94a7b2d51536baa5eb91a8cd50cdd6dfa99e (diff)
downloadrails-fadc02b7322c97f10d34fc04c147f3585eda1272.tar.gz
rails-fadc02b7322c97f10d34fc04c147f3585eda1272.tar.bz2
rails-fadc02b7322c97f10d34fc04c147f3585eda1272.zip
Added back the `encode_big_decimal_as_string` option with warning
Also added the missing CHANGELOG entry for #12183 @ 80e7552073 and 4d02296cfb.
Diffstat (limited to 'activesupport/test/json')
-rw-r--r--activesupport/test/json/encoding_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb
index 79e639b508..78cf4819f9 100644
--- a/activesupport/test/json/encoding_test.rb
+++ b/activesupport/test/json/encoding_test.rb
@@ -172,6 +172,22 @@ class TestJSONEncoding < ActiveSupport::TestCase
assert_equal "𐒑", decoded_hash['string']
end
+ def test_reading_encode_big_decimal_as_string_option
+ assert_deprecated do
+ assert ActiveSupport.encode_big_decimal_as_string
+ end
+ end
+
+ def test_setting_deprecated_encode_big_decimal_as_string_option
+ assert_raise(NotImplementedError) do
+ ActiveSupport.encode_big_decimal_as_string = true
+ end
+
+ assert_raise(NotImplementedError) do
+ ActiveSupport.encode_big_decimal_as_string = false
+ end
+ end
+
def test_exception_raised_when_encoding_circular_reference_in_array
a = [1]
a << a