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
This commit is contained in:
Jeremy Kemper
2007-10-06 00:40:28 +00:00
parent 55640fb939
commit b96c298f47

View File

@@ -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