Use DeserializeHelpers.deserialize_response

This commit is contained in:
Thor77 2018-11-24 20:34:13 +01:00
parent a8e6ac3dfd
commit 20288ff7e4
No known key found for this signature in database
GPG Key ID: 5051E71B46AA669A
1 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ RSpec.describe TeamsController, type: :controller do
it 'should return the correct team' do
get :show, params: { id: @team.to_param }
body = ActiveModelSerializers::Deserialization.jsonapi_parse(JSON.parse(response.body))
body = deserialize_response response
expect(body[:name]).to eq(@team.name)
end
end
@ -49,7 +49,7 @@ RSpec.describe TeamsController, type: :controller do
it 'renders a response with the updated team' do
put :update, params: { id: @team.to_param }.merge(valid_update)
expect(response).to be_successful
body = ActiveModelSerializers::Deserialization.jsonapi_parse(JSON.parse(response.body))
body = deserialize_response response
expect(body[:name]).to eq(valid_update[:data][:attributes][:name])
end
end