diff options
author | Erich Menge <erich.menge@me.com> | 2012-05-29 16:40:43 -0500 |
---|---|---|
committer | Erich Menge <erich.menge@me.com> | 2012-05-29 21:13:03 -0500 |
commit | 1e335ad1380f85e016260a8a3e38013376e1c109 (patch) | |
tree | 0fc5d6e806f71a504811f3338dbfba8b5ddb9239 /activesupport/test | |
parent | 669694fe888053ccc86e9a9d1d19adb8dba5fafb (diff) | |
download | rails-1e335ad1380f85e016260a8a3e38013376e1c109.tar.gz rails-1e335ad1380f85e016260a8a3e38013376e1c109.tar.bz2 rails-1e335ad1380f85e016260a8a3e38013376e1c109.zip |
True, False, and Nil should be represented in as_json as themselves.
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/json/encoding_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
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) |