Better handle empty user selection layers

This commit is contained in:
Paul Chavard 2018-10-22 14:17:30 +02:00
parent 4249f8ae25
commit c8c75fc254
4 changed files with 21 additions and 4 deletions

View file

@ -9,6 +9,12 @@ shared_examples 'champ_spec' do
it { expect(champ.mandatory_and_blank?).to be(true) }
end
context 'when carte mandatory and blank' do
let(:type_de_champ) { build(:type_de_champ_carte, mandatory: mandatory) }
let(:value) { '[]' }
it { expect(champ.mandatory_and_blank?).to be(true) }
end
context 'when not blank' do
let(:value) { 'yop' }
it { expect(champ.mandatory_and_blank?).to be(false) }