From 91386c1b355947955b05ee3846e4aedd4eec0eb1 Mon Sep 17 00:00:00 2001 From: namusyaka Date: Tue, 16 Feb 2016 11:35:52 +0900 Subject: Fix behavior of JSON encoding for Exception --- activesupport/test/json/encoding_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activesupport/test/json') diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb index 9f4b62fd8b..5fc2e16336 100644 --- a/activesupport/test/json/encoding_test.rb +++ b/activesupport/test/json/encoding_test.rb @@ -422,6 +422,11 @@ EXPECTED assert_equal '"1999-12-31T19:00:00.000-05:00"', ActiveSupport::JSON.encode(time) end + def test_exception_to_json + exception = Exception.new("foo") + assert_equal '"foo"', ActiveSupport::JSON.encode(exception) + end + protected def object_keys(json_object) -- cgit v1.2.3