Consolidate JSON parsing in serializers specs (#27693)
This commit is contained in:
parent
a688a9ed20
commit
1d51e10510
15 changed files with 25 additions and 84 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue