aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/json_serialization_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-10-06 00:40:28 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-10-06 00:40:28 +0000
commitb96c298f47d38bf9a5fd5f08511eb2e6dce7ff3e (patch)
tree759806b74bf8376334dbecb72f90d8d528b1fa5d /activerecord/test/json_serialization_test.rb
parent55640fb939ff76247adad28077ff7e01d3bf463b (diff)
downloadrails-b96c298f47d38bf9a5fd5f08511eb2e6dce7ff3e.tar.gz
rails-b96c298f47d38bf9a5fd5f08511eb2e6dce7ff3e.tar.bz2
rails-b96c298f47d38bf9a5fd5f08511eb2e6dce7ff3e.zip
Test for each JSON fragment to workaround assumed hash ordering.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7751 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/json_serialization_test.rb')
-rw-r--r--activerecord/test/json_serialization_test.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/test/json_serialization_test.rb b/activerecord/test/json_serialization_test.rb
index 3952a22c25..5aeb24b25d 100644
--- a/activerecord/test/json_serialization_test.rb
+++ b/activerecord/test/json_serialization_test.rb
@@ -163,7 +163,10 @@ class DatabaseConnectedJsonEncodingTest < Test::Unit::TestCase
}
)
- assert_equal %([{"name": "David", "posts": [{"id": 1}, {"id": 2}, {"id": 4}, {"id": 5}, {"id": 6}]}, {"name": "Mary", "posts": [{"id": 7}]}]), json
+ ['"name": "David"', '"posts": [', '{"id": 1}', '{"id": 2}', '{"id": 4}',
+ '{"id": 5}', '{"id": 6}', '"name": "Mary"', '"posts": [{"id": 7}]'].each do |fragment|
+ assert json.include?(fragment), json
+ end
end
def test_should_allow_options_for_hash_of_authors