Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit b96c298f47d38bf9a5fd5f08511eb2e6dce7ff3e 1 parent 55640fb
Jeremy Kemper jeremy authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 activerecord/test/json_serialization_test.rb
5 activerecord/test/json_serialization_test.rb
View
@@ -163,7 +163,10 @@ def test_should_allow_includes_for_list_of_authors
}
)
- 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
Please sign in to comment.
Something went wrong with that request. Please try again.