refactor: api_geo_services raises if wrong dep or city code
This commit is contained in:
parent
5b3277bb31
commit
c77b66feef
2 changed files with 0 additions and 9 deletions
|
@ -126,9 +126,6 @@ class APIGeoService
|
||||||
return fallback if department_code.nil? || city_code.nil?
|
return fallback if department_code.nil? || city_code.nil?
|
||||||
|
|
||||||
commune_name(department_code, city_code) || fallback
|
commune_name(department_code, city_code) || fallback
|
||||||
|
|
||||||
rescue StandardError
|
|
||||||
fallback
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -130,11 +130,5 @@ describe APIGeoService do
|
||||||
|
|
||||||
it { is_expected.to eq('Paris') }
|
it { is_expected.to eq('Paris') }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with a wrong department' do
|
|
||||||
let(:department_code) { 'wrong' }
|
|
||||||
|
|
||||||
it { is_expected.to eq('Paris') }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue