Mutualise a JSON#parse call
This commit is contained in:
parent
57b42e24e5
commit
9a7e13f72f
6 changed files with 11 additions and 9 deletions
|
@ -23,7 +23,7 @@ describe SIADE::API do
|
|||
let(:body) { File.read('spec/support/files/entreprise.json') }
|
||||
|
||||
it 'returns response body' do
|
||||
expect(subject).to eq(body)
|
||||
expect(subject).to eq(JSON.parse(body, symbolize_names: true))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -51,7 +51,7 @@ describe SIADE::API do
|
|||
let(:body) { File.read('spec/support/files/etablissement.json') }
|
||||
|
||||
it 'returns body' do
|
||||
expect(subject).to eq(body)
|
||||
expect(subject).to eq(JSON.parse(body, symbolize_names: true))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -82,7 +82,7 @@ describe SIADE::API do
|
|||
let(:body) { File.read('spec/support/files/exercices.json') }
|
||||
|
||||
it 'raises RestClient::Unauthorized' do
|
||||
expect(subject).to eq(body)
|
||||
expect(subject).to eq(JSON.parse(body, symbolize_names: true))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -110,7 +110,7 @@ describe SIADE::API do
|
|||
let(:status) { 200 }
|
||||
let(:body) { File.read('spec/support/files/rna.json') }
|
||||
|
||||
it{ expect(subject).to eq(body) }
|
||||
it { expect(subject).to eq(JSON.parse(body, symbolize_names: true)) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue