diff --git a/activerecord/test/json_serialization_test.rb b/activerecord/test/json_serialization_test.rb index eb4f90cf0f6f4f5a65c476b10bcebf6faac6aeea..3952a22c25d9bff4904f5a5725c935c2711cb733 100644 --- a/activerecord/test/json_serialization_test.rb +++ b/activerecord/test/json_serialization_test.rb @@ -23,7 +23,7 @@ def test_should_encode_all_encodable_attributes assert_match %r{"name": "Konata Izumi"}, json assert_match %r{"age": 16}, json - assert_match %r{"created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))}}, json + assert json.include?(%("created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))})) assert_match %r{"awesome": true}, json assert_match %r{"preferences": \{"shows": "anime"\}}, json end @@ -34,7 +34,7 @@ def test_should_allow_attribute_filtering_with_only assert_match %r{"name": "Konata Izumi"}, json assert_match %r{"age": 16}, json assert_no_match %r{"awesome": true}, json - assert_no_match %r{"created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))}}, json + assert !json.include?(%("created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))})) assert_no_match %r{"preferences": \{"shows": "anime"\}}, json end @@ -44,7 +44,7 @@ def test_should_allow_attribute_filtering_with_except assert_no_match %r{"name": "Konata Izumi"}, json assert_no_match %r{"age": 16}, json assert_match %r{"awesome": true}, json - assert_match %r{"created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))}}, json + assert json.include?(%("created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))})) assert_match %r{"preferences": \{"shows": "anime"\}}, json end @@ -174,4 +174,4 @@ def test_should_allow_options_for_hash_of_authors assert_equal %({1: {"name": "David"}}), authors_hash.to_json(:only => [1, :name]) end -end \ No newline at end of file +end