[Fix #2833] Move /support files to /fixtures

This commit is contained in:
gregoirenovel 2018-10-16 00:01:53 +02:00
parent 758c47343f
commit baf69acbcb
48 changed files with 52 additions and 52 deletions

View file

@ -3,7 +3,7 @@ require 'spec_helper'
describe ApiAdresse::AddressAdapter do
describe '#get_suggestions' do
let(:request) { 'Paris' }
let(:response) { File.open('spec/support/files/api_adresse/search_results.json') }
let(:response) { File.open('spec/fixtures/files/api_adresse/search_results.json') }
let(:status) { 200 }
subject { described_class.new(request).get_suggestions }
@ -19,7 +19,7 @@ describe ApiAdresse::AddressAdapter do
end
context 'when address return an empty list' do
let(:response) { File.open('spec/support/files/api_adresse/search_no_results.json') }
let(:response) { File.open('spec/fixtures/files/api_adresse/search_no_results.json') }
it { expect(subject.size).to eq 0 }
it { is_expected.to be_an_instance_of Array }

View file

@ -21,7 +21,7 @@ describe ApiCarto::API do
end
context 'when request return 500' do
let(:geojson) { File.read('spec/support/files/api_carto/request_qp.json') }
let(:geojson) { File.read('spec/fixtures/files/api_carto/request_qp.json') }
let(:status) { 500 }
let(:body) { 'toto' }
@ -31,7 +31,7 @@ describe ApiCarto::API do
end
context 'when geojson exist' do
let(:geojson) { File.read('spec/support/files/api_carto/request_qp.json') }
let(:geojson) { File.read('spec/fixtures/files/api_carto/request_qp.json') }
let(:status) { 200 }
let(:body) { 'toto' }
@ -40,7 +40,7 @@ describe ApiCarto::API do
end
context 'when geojson is at format JSON' do
let(:geojson) { JSON.parse(File.read('spec/support/files/api_carto/request_qp.json')) }
let(:geojson) { JSON.parse(File.read('spec/fixtures/files/api_carto/request_qp.json')) }
it 'returns response body' do
expect(subject).to eq(body)
@ -69,7 +69,7 @@ describe ApiCarto::API do
end
context 'when geojson exist' do
let(:geojson) { File.read('spec/support/files/api_carto/request_cadastre.json') }
let(:geojson) { File.read('spec/fixtures/files/api_carto/request_cadastre.json') }
let(:status) { 200 }
let(:body) { 'toto' }
@ -78,7 +78,7 @@ describe ApiCarto::API do
end
context 'when geojson is at format JSON' do
let(:geojson) { JSON.parse(File.read('spec/support/files/api_carto/request_cadastre.json')) }
let(:geojson) { JSON.parse(File.read('spec/fixtures/files/api_carto/request_cadastre.json')) }
it 'returns response body' do
expect(subject).to eq(body)

View file

@ -13,7 +13,7 @@ describe ApiCarto::CadastreAdapter do
context 'coordinates are filled' do
let(:coordinates) { '[[2.252728, 43.27151][2.323223, 32.835332]]' }
let(:status) { 200 }
let(:body) { File.read('spec/support/files/api_carto/response_cadastre.json') }
let(:body) { File.read('spec/fixtures/files/api_carto/response_cadastre.json') }
it { expect(subject).to be_a_instance_of(Array) }
it { expect(subject.size).to eq(16) }

View file

@ -13,7 +13,7 @@ describe ApiCarto::QuartiersPrioritairesAdapter do
context 'coordinates are filled' do
let(:coordinates) { '[[2.252728, 43.27151][2.323223, 32.835332]]' }
let(:status) { 200 }
let(:body) { File.read('spec/support/files/api_carto/response_qp.json') }
let(:body) { File.read('spec/fixtures/files/api_carto/response_qp.json') }
it { expect(subject).to be_a_instance_of(Array) }

View file

@ -20,7 +20,7 @@ describe ApiEntreprise::API do
context 'when siret exist' do
let(:siren) { '418166096' }
let(:status) { 200 }
let(:body) { File.read('spec/support/files/api_entreprise/entreprises.json') }
let(:body) { File.read('spec/fixtures/files/api_entreprise/entreprises.json') }
it 'returns response body' do
expect(subject).to eq(JSON.parse(body, symbolize_names: true))
@ -48,7 +48,7 @@ describe ApiEntreprise::API do
context 'when siret exists' do
let(:siret) { '41816609600051' }
let(:status) { 200 }
let(:body) { File.read('spec/support/files/api_entreprise/etablissements.json') }
let(:body) { File.read('spec/fixtures/files/api_entreprise/etablissements.json') }
it 'returns body' do
expect(subject).to eq(JSON.parse(body, symbolize_names: true))
@ -79,7 +79,7 @@ describe ApiEntreprise::API do
let(:siret) { '41816609600051' }
let(:status) { 200 }
let(:body) { File.read('spec/support/files/api_entreprise/exercices.json') }
let(:body) { File.read('spec/fixtures/files/api_entreprise/exercices.json') }
it 'raises RestClient::Unauthorized' do
expect(subject).to eq(JSON.parse(body, symbolize_names: true))
@ -108,7 +108,7 @@ describe ApiEntreprise::API do
context 'when siren exists' do
let(:siren) { '418166096' }
let(:status) { 200 }
let(:body) { File.read('spec/support/files/api_entreprise/associations.json') }
let(:body) { File.read('spec/fixtures/files/api_entreprise/associations.json') }
it { expect(subject).to eq(JSON.parse(body, symbolize_names: true)) }
end

View file

@ -8,7 +8,7 @@ describe ApiEntreprise::EntrepriseAdapter do
before do
stub_request(:get, /https:\/\/entreprise.api.gouv.fr\/v2\/entreprises\/#{siren}?.*token=/)
.to_return(body: File.read('spec/support/files/api_entreprise/entreprises.json', status: 200))
.to_return(body: File.read('spec/fixtures/files/api_entreprise/entreprises.json', status: 200))
end
it '#to_params class est une Hash ?' do

View file

@ -9,7 +9,7 @@ describe ApiEntreprise::EtablissementAdapter do
before do
stub_request(:get, /https:\/\/entreprise.api.gouv.fr\/v2\/etablissements\/#{siret}?.*token=/)
.to_return(body: File.read('spec/support/files/api_entreprise/etablissements.json', status: 200))
.to_return(body: File.read('spec/fixtures/files/api_entreprise/etablissements.json', status: 200))
end
it '#to_params class est une Hash ?' do

View file

@ -7,7 +7,7 @@ describe ApiEntreprise::ExercicesAdapter do
before do
stub_request(:get, /https:\/\/entreprise.api.gouv.fr\/v2\/exercices\/.*token=/)
.to_return(body: File.read('spec/support/files/api_entreprise/exercices.json', status: 200))
.to_return(body: File.read('spec/fixtures/files/api_entreprise/exercices.json', status: 200))
end
it '#to_params class est un Hash ?' do

View file

@ -3,7 +3,7 @@ require 'spec_helper'
describe ApiEntreprise::RNAAdapter do
let(:siret) { '50480511000013' }
let(:procedure_id) { 22 }
let(:body) { File.read('spec/support/files/api_entreprise/associations.json') }
let(:body) { File.read('spec/fixtures/files/api_entreprise/associations.json') }
let(:status) { 200 }
let(:adapter) { described_class.new(siret, procedure_id) }