fix specs
This commit is contained in:
parent
3d20ef6af9
commit
77240f40c8
6 changed files with 16 additions and 17 deletions
|
@ -157,15 +157,16 @@ describe 'user access to the list of their dossiers', js: true do
|
|||
|
||||
context 'when user clicks on delete button', js: true do
|
||||
scenario 'the dossier is deleted' do
|
||||
within(:css, "tr[data-dossier-id=\"#{dossier_brouillon.id}\"]") do
|
||||
click_on 'Actions'
|
||||
expect(page).to have_content(dossier_en_construction.procedure.libelle)
|
||||
within(:css, ".card", match: :first) do
|
||||
click_on 'Autres actions'
|
||||
page.accept_alert('Confirmer la suppression ?') do
|
||||
click_on 'Supprimer le dossier'
|
||||
end
|
||||
end
|
||||
|
||||
expect(page).to have_content('Votre dossier a bien été supprimé')
|
||||
expect(page).not_to have_content(dossier_brouillon.procedure.libelle)
|
||||
expect(page).not_to have_content(dossier_en_construction.procedure.libelle)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -177,13 +178,15 @@ describe 'user access to the list of their dossiers', js: true do
|
|||
end
|
||||
|
||||
context 'when user clicks on clone button', js: true do
|
||||
scenario 'the dossier is deleted' do
|
||||
within(:css, "tr[data-dossier-id=\"#{dossier_brouillon.id}\"]") do
|
||||
click_on 'Actions'
|
||||
scenario 'the dossier is cloned' do
|
||||
expect(Dossier.count).to eq(8)
|
||||
within(:css, ".card", match: :first) do
|
||||
click_on 'Autres actions'
|
||||
click_on 'Dupliquer ce dossier'
|
||||
end
|
||||
|
||||
expect(page).to have_content("Votre dossier a bien été dupliqué. Vous pouvez maintenant le vérifier, l’adapter puis le déposer.")
|
||||
expect(Dossier.count).to eq(9)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue