0
0
Fork 0

Consolidate JSON parsing in serializers specs (#27693)

This commit is contained in:
Matt Jankowski 2023-11-07 10:20:24 -05:00 committed by GitHub
parent a688a9ed20
commit 1d51e10510
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 25 additions and 84 deletions

View file

@ -8,13 +8,11 @@ describe EmojisController do
let(:emoji) { Fabricate(:custom_emoji) }
describe 'GET #show' do
subject(:body) { JSON.parse(response.body, symbolize_names: true) }
let(:response) { get :show, params: { id: emoji.id, format: :json } }
it 'returns the right response' do
expect(response).to have_http_status 200
expect(body[:name]).to eq ':coolcat:'
expect(body_as_json[:name]).to eq ':coolcat:'
end
end
end