spec
This commit is contained in:
parent
0b90c81c3a
commit
ec40836589
1 changed files with 25 additions and 0 deletions
|
@ -269,6 +269,31 @@ describe 'The user' do
|
||||||
context 'with condition' do
|
context 'with condition' do
|
||||||
include Logic
|
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
|
context 'with a visibilite in cascade' do
|
||||||
let(:procedure) do
|
let(:procedure) do
|
||||||
procedure = create(:procedure, :for_individual).tap do |p|
|
procedure = create(:procedure, :for_individual).tap do |p|
|
||||||
|
|
Loading…
Add table
Reference in a new issue