From b96c298f47d38bf9a5fd5f08511eb2e6dce7ff3e Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 6 Oct 2007 00:40:28 +0000 Subject: [PATCH] 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 --- activerecord/test/json_serialization_test.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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