aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorErich Menge <erich.menge@me.com>2012-05-30 10:24:23 -0500
committerErich Menge <erich.menge@me.com>2012-05-30 10:24:23 -0500
commit624f801d27e946cae2244924e7f6a04565666036 (patch)
tree7de4afec17a1d1d7aa40405f1bc9b89663381b75 /activesupport/test
parentf09ae8538f3625468ee175d5a4d9782e0d5ba415 (diff)
downloadrails-624f801d27e946cae2244924e7f6a04565666036.tar.gz
rails-624f801d27e946cae2244924e7f6a04565666036.tar.bz2
rails-624f801d27e946cae2244924e7f6a04565666036.zip
True, False, and Nil should be represented in as_json as themselves.
Conflicts: activesupport/lib/active_support/json/encoding.rb activesupport/test/json/encoding_test.rb
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/json/encoding_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb
index 8cf1a54a99..a9590f164f 100644
--- a/activesupport/test/json/encoding_test.rb
+++ b/activesupport/test/json/encoding_test.rb
@@ -270,6 +270,12 @@ class TestJSONEncoding < Test::Unit::TestCase
JSON.parse(json_string_and_date))
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)