Merge pull request #9106 from mfo/api-entreprise.etablissement_adapter

API Entreprise: migration "Etablissement"
This commit is contained in:
mfo 2023-06-01 11:45:47 +00:00 committed by GitHub
commit c2f2b4ef2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 359 additions and 201 deletions

View file

@ -67,7 +67,7 @@ describe 'Creating a new dossier:' do
let(:dossier) { procedure.dossiers.last }
before do
stub_request(:get, /https:\/\/entreprise.api.gouv.fr\/v2\/etablissements\/#{siret}/)
stub_request(:get, /https:\/\/entreprise.api.gouv.fr\/v3\/insee\/sirene\/etablissements\/#{siret}/)
.to_return(status: 200, body: File.read('spec/fixtures/files/api_entreprise/etablissements.json'))
stub_request(:get, /https:\/\/entreprise.api.gouv.fr\/v3\/insee\/sirene\/unites_legales\/#{siren}/)
.to_return(status: 200, body: File.read('spec/fixtures/files/api_entreprise/entreprises.json'))
@ -96,7 +96,7 @@ describe 'Creating a new dossier:' do
click_on 'Valider'
expect(page).to have_current_path(etablissement_dossier_path(dossier))
expect(page).to have_content('OCTO TECHNOLOGY')
expect(page).to have_content('Coiff Land, CoiffureLand')
click_on 'Continuer avec ces informations'
expect(page).to have_current_path(brouillon_dossier_path(dossier))

View file

@ -64,7 +64,7 @@ describe 'Prefilling a dossier (with a GET request):', js: true do
}
before do
stub_request(:get, /https:\/\/entreprise.api.gouv.fr\/v2\/etablissements\//)
stub_request(:get, /https:\/\/entreprise.api.gouv.fr\/v3\/insee\/sirene\/etablissements\//)
.to_return(status: 200, body: File.read('spec/fixtures/files/api_entreprise/etablissements.json'))
stub_request(:get, /https:\/\/entreprise.api.gouv.fr\/v3\/insee\/sirene\/unites_legales\/#{siret_value[0..8]}/)

View file

@ -41,7 +41,7 @@ describe 'Prefilling a dossier (with a POST request):', js: true do
let(:annuaire_education_value) { '0050009H' }
before do
stub_request(:get, /https:\/\/entreprise.api.gouv.fr\/v2\/etablissements\/#{siret_value}/)
stub_request(:get, /https:\/\/entreprise.api.gouv.fr\/v3\/insee\/sirene\/etablissements\/#{siret_value}/)
.to_return(status: 200, body: File.read('spec/fixtures/files/api_entreprise/etablissements.json'))
stub_request(:get, /https:\/\/entreprise.api.gouv.fr\/v3\/insee\/sirene\/unites_legales\/#{siret_value[0..8]}/)