From 1e335ad1380f85e016260a8a3e38013376e1c109 Mon Sep 17 00:00:00 2001 From: Erich Menge Date: Tue, 29 May 2012 16:40:43 -0500 Subject: True, False, and Nil should be represented in as_json as themselves. --- activesupport/test/json/encoding_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activesupport/test/json') diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb index 0566ebf291..212ee262a3 100644 --- a/activesupport/test/json/encoding_test.rb +++ b/activesupport/test/json/encoding_test.rb @@ -285,6 +285,12 @@ class TestJSONEncoding < ActiveSupport::TestCase end end + def test_nil_true_and_false_represented_as_themselves + assert_equal nil, nil.as_json + assert_equal true, true.as_json + assert_equal false, false.as_json + end + protected def object_keys(json_object) -- cgit v1.2.3