Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rewrite order dependent test case. #8185

As reported (rails#8185 (comment))
this test relied on the order a hash was serialized. Comparing the parsed
hash makes the test no longer order dependent.
  • Loading branch information...
commit e68505a41a5c4ceeb0ed343daa0433846b054076 1 parent 2283a1d
@senny senny authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  activesupport/test/json/encoding_test.rb
View
3  activesupport/test/json/encoding_test.rb
@@ -276,7 +276,8 @@ def test_to_json_should_not_keep_options_around
f.bar = "world"
hash = {"foo" => f, "other_hash" => {"foo" => "other_foo", "test" => "other_test"}}
- assert_equal(%({"foo":{"foo":"hello","bar":"world"},"other_hash":{"foo":"other_foo","test":"other_test"}}), hash.to_json)
+ assert_equal({"foo"=>{"foo"=>"hello","bar"=>"world"},
+ "other_hash" => {"foo"=>"other_foo","test"=>"other_test"}}, JSON.parse(hash.to_json))
end
def test_struct_encoding
Please sign in to comment.
Something went wrong with that request. Please try again.