1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix test failure

```
...
(snip)
............F
Failure:
JsonSerializationTest#test_as_json_should_return_a_hash_if_include_root_
in_json_is_true [/home/travis/build/rails/rails/activemodel/test/cases/serializers/json_serialization_test.rb:145]:
Expected: 2006-08-01 00:00:00 UTC
  Actual: "2006-08-01T00:00:00.000Z"
rails test home/travis/build/rails/rails/activemodel/test/cases/serializers/json_serialization_test.rb:136
(snip)
...
```

Related to #31503
This commit is contained in:
bogdanvlviv 2018-08-11 19:19:04 +03:00
parent 09e1452eeb
commit 3a0a8cf604
No known key found for this signature in database
GPG key ID: E4ACD76A6DB6DFDD

View file

@ -142,7 +142,7 @@ class JsonSerializationTest < ActiveModel::TestCase
assert_kind_of Hash, json
assert_kind_of Hash, json["contact"]
%w(name age created_at awesome preferences).each do |field|
assert_equal @contact.send(field), json["contact"][field]
assert_equal @contact.send(field).as_json, json["contact"][field]
end
ensure
Contact.include_root_in_json = original_include_root_in_json