Champs editor should handle repetition type
This commit is contained in:
parent
9728721a12
commit
9b7b59f67e
13 changed files with 148 additions and 55 deletions
|
@ -105,7 +105,7 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
|
|||
end
|
||||
expect(page).to have_selector('#procedure_types_de_champ_attributes_0_libelle')
|
||||
fill_in 'procedure_types_de_champ_attributes_0_libelle', with: 'libelle de champ'
|
||||
expect(page).to have_content('Champs enregistrés')
|
||||
expect(page).to have_content('Formulaire mis à jour')
|
||||
|
||||
within '.footer' do
|
||||
click_on 'Ajouter un champ'
|
||||
|
@ -135,7 +135,7 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
|
|||
click_on 'Ajouter un champ'
|
||||
end
|
||||
fill_in 'procedure_types_de_champ_attributes_0_libelle', with: 'libelle de champ'
|
||||
expect(page).to have_content('Champs enregistrés')
|
||||
expect(page).to have_content('Formulaire mis à jour')
|
||||
|
||||
click_on Procedure.last.libelle
|
||||
click_on 'onglet-pieces'
|
||||
|
|
|
@ -5,6 +5,7 @@ feature 'As an administrateur I edit procedure', js: true do
|
|||
let(:procedure) { create(:procedure) }
|
||||
|
||||
before do
|
||||
Flipflop::FeatureSet.current.test!.switch!(:champ_repetition, true)
|
||||
login_as administrateur, scope: :administrateur
|
||||
visit champs_procedure_path(procedure)
|
||||
end
|
||||
|
@ -15,14 +16,14 @@ feature 'As an administrateur I edit procedure', js: true do
|
|||
end
|
||||
expect(page).to have_selector('#procedure_types_de_champ_attributes_0_libelle')
|
||||
fill_in 'procedure_types_de_champ_attributes_0_libelle', with: 'libellé de champ'
|
||||
expect(page).to have_content('Champs enregistrés')
|
||||
expect(page).to have_content('Formulaire mis à jour')
|
||||
|
||||
page.refresh
|
||||
within '.footer' do
|
||||
click_on 'Enregistrer'
|
||||
end
|
||||
|
||||
expect(page).to have_content('Champs enregistrés')
|
||||
expect(page).to have_content('Formulaire mis à jour')
|
||||
end
|
||||
|
||||
it "Add multiple champs" do
|
||||
|
@ -34,7 +35,7 @@ feature 'As an administrateur I edit procedure', js: true do
|
|||
end
|
||||
expect(page).not_to have_content('Le libellé doit être rempli.')
|
||||
expect(page).not_to have_content('Modifications non sauvegardées.')
|
||||
expect(page).not_to have_content('Champs enregistrés')
|
||||
expect(page).not_to have_content('Formulaire mis à jour')
|
||||
fill_in 'procedure_types_de_champ_attributes_0_libelle', with: 'libellé de champ 0'
|
||||
|
||||
expect(page).to have_selector('#procedure_types_de_champ_attributes_0_libelle')
|
||||
|
@ -44,7 +45,7 @@ feature 'As an administrateur I edit procedure', js: true do
|
|||
|
||||
expect(page).to have_content('Le libellé doit être rempli.')
|
||||
expect(page).to have_content('Modifications non sauvegardées.')
|
||||
expect(page).not_to have_content('Champs enregistrés')
|
||||
expect(page).not_to have_content('Formulaire mis à jour')
|
||||
fill_in 'procedure_types_de_champ_attributes_2_libelle', with: 'libellé de champ 2'
|
||||
|
||||
within '.draggable-item-3' do
|
||||
|
@ -53,12 +54,12 @@ feature 'As an administrateur I edit procedure', js: true do
|
|||
|
||||
expect(page).to have_content('Le libellé doit être rempli.')
|
||||
expect(page).to have_content('Modifications non sauvegardées.')
|
||||
expect(page).not_to have_content('Champs enregistrés')
|
||||
expect(page).not_to have_content('Formulaire mis à jour')
|
||||
fill_in 'procedure_types_de_champ_attributes_1_libelle', with: 'libellé de champ 1'
|
||||
|
||||
expect(page).not_to have_content('Le libellé doit être rempli.')
|
||||
expect(page).not_to have_content('Modifications non sauvegardées.')
|
||||
expect(page).to have_content('Champs enregistrés')
|
||||
expect(page).to have_content('Formulaire mis à jour')
|
||||
page.refresh
|
||||
|
||||
expect(page).to have_content('Supprimer', count: 3)
|
||||
|
@ -69,11 +70,11 @@ feature 'As an administrateur I edit procedure', js: true do
|
|||
click_on 'Ajouter un champ'
|
||||
end
|
||||
fill_in 'procedure_types_de_champ_attributes_0_libelle', with: 'libellé de champ'
|
||||
expect(page).to have_content('Champs enregistrés')
|
||||
expect(page).to have_content('Formulaire mis à jour')
|
||||
page.refresh
|
||||
|
||||
click_on 'Supprimer'
|
||||
expect(page).to have_content('Champs enregistrés')
|
||||
expect(page).to have_content('Formulaire mis à jour')
|
||||
expect(page).not_to have_content('Supprimer')
|
||||
page.refresh
|
||||
|
||||
|
@ -87,9 +88,39 @@ feature 'As an administrateur I edit procedure', js: true do
|
|||
expect(page).to have_selector('#procedure_types_de_champ_attributes_0_description')
|
||||
fill_in 'procedure_types_de_champ_attributes_0_description', with: 'déscription du champ'
|
||||
expect(page).to have_content('Le libellé doit être rempli.')
|
||||
expect(page).not_to have_content('Champs enregistrés')
|
||||
expect(page).not_to have_content('Formulaire mis à jour')
|
||||
|
||||
fill_in 'procedure_types_de_champ_attributes_0_libelle', with: 'libellé de champ'
|
||||
expect(page).to have_content('Champs enregistrés')
|
||||
expect(page).to have_content('Formulaire mis à jour')
|
||||
end
|
||||
|
||||
it "Add repetition champ" do
|
||||
within '.footer' do
|
||||
click_on 'Ajouter un champ'
|
||||
end
|
||||
expect(page).to have_selector('#procedure_types_de_champ_attributes_0_libelle')
|
||||
select('Bloc répétable', from: 'procedure_types_de_champ_attributes_0_type_champ')
|
||||
fill_in 'procedure_types_de_champ_attributes_0_libelle', with: 'libellé de champ'
|
||||
|
||||
expect(page).to have_content('Formulaire mis à jour')
|
||||
page.refresh
|
||||
|
||||
within '.flex-grow' do
|
||||
click_on 'Ajouter un champ'
|
||||
end
|
||||
|
||||
fill_in 'procedure_types_de_champ_attributes_0_types_de_champ_attributes_0_libelle', with: 'libellé de champ 1'
|
||||
|
||||
expect(page).to have_content('Formulaire mis à jour')
|
||||
expect(page).to have_content('Supprimer', count: 2)
|
||||
|
||||
within '.footer' do
|
||||
click_on 'Ajouter un champ'
|
||||
end
|
||||
|
||||
select('Bloc répétable', from: 'procedure_types_de_champ_attributes_1_type_champ')
|
||||
fill_in 'procedure_types_de_champ_attributes_1_libelle', with: 'libellé de champ 2'
|
||||
|
||||
expect(page).to have_content('Supprimer', count: 3)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue