api_entreprise: display a specific error message on network errors
This commit is contained in:
parent
ad4a89f0f6
commit
e06e32238c
7 changed files with 71 additions and 22 deletions
|
@ -278,6 +278,13 @@ describe Users::DossiersController, type: :controller do
|
|||
context 'with a valid SIRET' do
|
||||
let(:params_siret) { '440 117 620 01530' }
|
||||
|
||||
context 'When API-Entreprise is down' do
|
||||
let(:api_etablissement_status) { 502 }
|
||||
let(:api_body_status) { File.read('spec/fixtures/files/api_entreprise/exercices_unavailable.json') }
|
||||
|
||||
it_behaves_like 'the request fails with an error', I18n.t('errors.messages.siret_network_error')
|
||||
end
|
||||
|
||||
context 'when API-Entreprise doesn’t know this SIRET' do
|
||||
let(:api_etablissement_status) { 404 }
|
||||
let(:api_body_status) { '' }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue