This commit is contained in:
simon lehericey 2022-08-08 17:11:20 +02:00
parent 0b90c81c3a
commit ec40836589

View file

@ -269,6 +269,31 @@ describe 'The user' do
context 'with condition' do
include Logic
context 'with a required conditionnal champ' do
let(:procedure) do
procedure = create(:procedure, :published, :for_individual,
types_de_champ_public: [
{ type: :integer_number, libelle: 'age' },
{ type: :text, libelle: 'nom', mandatory: true }
])
age, nom = procedure.draft_revision.types_de_champ.all
nom.update(condition: greater_than_eq(champ_value(age.stable_id), constant(18)))
procedure
end
scenario 'submit a dossier with an hidden mandatory champ ', js: true do
log_in(user, procedure)
fill_individual
click_on 'Déposer le dossier'
expect(page).to have_current_path(merci_dossier_path(user_dossier))
end
end
context 'with a visibilite in cascade' do
let(:procedure) do
procedure = create(:procedure, :for_individual).tap do |p|