diff --git a/test/helpers/functional_helpers.rb b/test/helpers/functional_helpers.rb index 3d6dc9d3..b3ce85f8 100644 --- a/test/helpers/functional_helpers.rb +++ b/test/helpers/functional_helpers.rb @@ -53,7 +53,7 @@ module FunctionalHelpers # end # def json_response - JSON.parse(@response.body) + @response.parsed_body end end -end \ No newline at end of file +end diff --git a/test/integration/requests/request_test.rb b/test/integration/requests/request_test.rb index 008bb2a6..52531514 100644 --- a/test/integration/requests/request_test.rb +++ b/test/integration/requests/request_test.rb @@ -348,7 +348,7 @@ def test_post_polymorphic_with_has_many_relationship assert_jsonapi_response 201 - body = JSON.parse(response.body) + body = response.parsed_body person = Person.find(body.dig("data", "id")) assert_equal "Reo", person.name @@ -649,7 +649,7 @@ def test_patch_polymorphic_with_has_many_relationship assert_jsonapi_response 200 - body = JSON.parse(response.body) + body = response.parsed_body person = Person.find(body.dig("data", "id")) assert_equal "Reo", person.name