bug(date): la validation est trop lache

This commit is contained in:
Martin 2023-01-26 10:28:24 +01:00 committed by Colin Darie
parent c04dcb47e4
commit 78f9910fd0

View file

@ -39,6 +39,14 @@ describe Champs::DateChamp do
end
end
describe 'validate :iso_8601' do
it 'works' do
date_champ.value = '2023-27-02'
date_champ.send(:iso_8601)
expect(date_champ.valid?).to eq(false)
expect(date_champ.to_s).not_to raise_error
end
end
def champ_with_value(number)
date_champ.tap { |c| c.value = number }
end