Add champ address model
This commit is contained in:
parent
228a83f8a5
commit
75392272fb
2 changed files with 63 additions and 0 deletions
20
spec/models/champs/address_champ_spec.rb
Normal file
20
spec/models/champs/address_champ_spec.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
describe Champs::AddressChamp do
|
||||
let(:champ) { Champs::AddressChamp.new(value: value, data: data, type_de_champ: create(:type_de_champ_address)) }
|
||||
let(:value) { '' }
|
||||
let(:data) { nil }
|
||||
|
||||
context "with value but no data" do
|
||||
let(:value) { 'Paris' }
|
||||
|
||||
it { expect(champ.address_label).to eq('Paris') }
|
||||
it { expect(champ.full_address?).to be_falsey }
|
||||
end
|
||||
|
||||
context "with value and data" do
|
||||
let(:value) { 'Paris' }
|
||||
let(:data) { { label: 'Paris' } }
|
||||
|
||||
it { expect(champ.address_label).to eq('Paris') }
|
||||
it { expect(champ.full_address?).to be_truthy }
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue