Revert "Remove data_provide and data_date_format attributes"

This reverts commit 273b3f2faf.
This commit is contained in:
Mathieu Magnin 2018-01-19 13:20:53 +01:00
parent ccad372036
commit 469aca999b
11 changed files with 51 additions and 16 deletions

View file

@ -26,6 +26,28 @@ shared_examples 'champ_spec' do
end
end
describe 'data_provide' do
let(:champ) { create :champ }
subject { champ.data_provide }
context 'when type_champ is datetime' do
before do
champ.type_de_champ = create :type_de_champ_public, type_champ: 'datetime'
end
it { is_expected.to eq 'datepicker' }
end
context 'when type_champ is address' do
before do
champ.type_de_champ = create :type_de_champ_public, type_champ: 'address'
end
it { is_expected.to eq 'typeahead' }
end
end
describe '.departement', vcr: { cassette_name: 'call_geo_api_departements' } do
subject { Champ.departements }