@@ -171,14 +171,14 @@ def @contact.favorite_quote; "Constraints are liberating"; end
171
171
json = @contact . as_json ( except : [ :age , :created_at , :awesome , :preferences ] )
172
172
173
173
assert_kind_of Hash , json
174
- assert_equal json , { "name" => "Konata Izumi" }
174
+ assert_equal ( { "name" => "Konata Izumi" } , json )
175
175
end
176
176
177
177
test "as_json should allow attribute filtering with only" do
178
178
json = @contact . as_json ( only : :name )
179
179
180
180
assert_kind_of Hash , json
181
- assert_equal json , { "name" => "Konata Izumi" }
181
+ assert_equal ( { "name" => "Konata Izumi" } , json )
182
182
end
183
183
184
184
test "as_json should work with methods options" do
@@ -210,7 +210,7 @@ def @contact.favorite_quote; "Constraints are liberating"; end
210
210
%w( name age created_at awesome preferences ) . each do |field |
211
211
assert_equal @contact . public_send ( field ) . as_json , json [ field ]
212
212
end
213
- assert_equal json [ "address" ] , { "city" => "Trichy" }
213
+ assert_equal ( { "city" => "Trichy" } , json [ "address" ] )
214
214
end
215
215
216
216
test "as_json should work with include option paired with except filter" do
@@ -220,7 +220,7 @@ def @contact.favorite_quote; "Constraints are liberating"; end
220
220
%w( name age created_at awesome preferences ) . each do |field |
221
221
assert_equal @contact . public_send ( field ) . as_json , json [ field ]
222
222
end
223
- assert_equal json [ "address" ] , { "city" => "Trichy" }
223
+ assert_equal ( { "city" => "Trichy" } , json [ "address" ] )
224
224
end
225
225
226
226
test "from_json should work without a root (class attribute)" do
0 commit comments