aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/json/encoding_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-10-24 16:21:46 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-10-24 16:21:46 +0000
commit7c3581cba243aa17a9f002b40c5f017d8e968492 (patch)
treef9abe4deff8a5587e0a72bbc9a47a11eccb388f9 /activesupport/test/json/encoding_test.rb
parent4c2920e89c563f9e5e9c79c7da7d226cdddcc859 (diff)
downloadrails-7c3581cba243aa17a9f002b40c5f017d8e968492.tar.gz
rails-7c3581cba243aa17a9f002b40c5f017d8e968492.tar.bz2
rails-7c3581cba243aa17a9f002b40c5f017d8e968492.zip
Document Enumerable and Hash #to_json. Add test for hash with integer key. Closes #9970.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8010 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/json/encoding_test.rb')
-rw-r--r--activesupport/test/json/encoding_test.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb
index c42832b371..923f4b8396 100644
--- a/activesupport/test/json/encoding_test.rb
+++ b/activesupport/test/json/encoding_test.rb
@@ -45,6 +45,7 @@ class TestJSONEncoding < Test::Unit::TestCase
assert_equal %({\"a\": \"b\"}), { :a => :b }.to_json
assert_equal %({\"a\": 1}), { 'a' => 1 }.to_json
assert_equal %({\"a\": [1, 2]}), { 'a' => [1,2] }.to_json
+ assert_equal %({1: 2}), { 1 => 2 }.to_json
sorted_json = '{' + {:a => :b, :c => :d}.to_json[1..-2].split(', ').sort.join(', ') + '}'
assert_equal %({\"a\": \"b\", \"c\": \"d\"}), sorted_json