review: detailled error message

This commit is contained in:
sebastiencarceles 2023-01-16 15:14:53 +01:00
parent 2ad4e4c01f
commit 30eef3e128
6 changed files with 43 additions and 10 deletions

View file

@ -34,10 +34,16 @@ RSpec.describe SiretChampEtablissementFetchableConcern do
it_behaves_like 'an error occured', :empty
end
context 'when the SIRET is invalid' do
context "when the SIRET is invalid because of it's length" do
let(:siret) { '1234' }
it_behaves_like 'an error occured', :invalid
it_behaves_like 'an error occured', :invalid_length
end
context "when the SIRET is invalid because of it's checksum" do
let(:siret) { '82812345600023' }
it_behaves_like 'an error occured', :invalid_checksum
end
context 'when the API is unavailable due to network error' do