2015-08-17 11:51:00 +02:00
|
|
|
describe Etablissement do
|
2016-01-19 17:19:38 +01:00
|
|
|
describe '#geo_adresse' do
|
|
|
|
let(:etablissement) { create(:etablissement) }
|
|
|
|
|
|
|
|
subject { etablissement.geo_adresse }
|
|
|
|
|
|
|
|
it { is_expected.to eq '6 RUE RAOUL NORDLING IMMEUBLE BORA 92270 BOIS COLOMBES' }
|
|
|
|
end
|
2017-06-22 14:58:29 +02:00
|
|
|
|
|
|
|
describe '#inline_adresse' do
|
|
|
|
let(:etablissement) { create(:etablissement, nom_voie: 'green moon') }
|
|
|
|
|
|
|
|
it { expect(etablissement.inline_adresse).to eq '6 RUE green moon, IMMEUBLE BORA, 92270 BOIS COLOMBES' }
|
2019-02-13 09:57:33 +01:00
|
|
|
|
|
|
|
context 'with missing complement adresse' do
|
2019-02-13 19:22:38 +01:00
|
|
|
let(:expected_adresse) { '6 RUE RAOUL NORDLING, 92270 BOIS COLOMBES' }
|
|
|
|
subject { etablissement.inline_adresse }
|
2019-02-13 09:57:33 +01:00
|
|
|
|
2019-02-13 19:22:38 +01:00
|
|
|
context 'when blank' do
|
|
|
|
let(:etablissement) { create(:etablissement, complement_adresse: '') }
|
|
|
|
|
|
|
|
it { is_expected.to eq expected_adresse }
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when whitespace' do
|
|
|
|
let(:etablissement) { create(:etablissement, complement_adresse: ' ') }
|
|
|
|
|
|
|
|
it { is_expected.to eq expected_adresse }
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when nil' do
|
|
|
|
let(:etablissement) { create(:etablissement, complement_adresse: nil) }
|
|
|
|
|
|
|
|
it { is_expected.to eq expected_adresse }
|
|
|
|
end
|
2019-02-13 09:57:33 +01:00
|
|
|
end
|
2017-06-22 14:58:29 +02:00
|
|
|
end
|
2015-08-17 11:51:00 +02:00
|
|
|
end
|