Ask confirmation to delete drafts and questions
This is similar to what we do in almost every other page of the admin section.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
:destroy,
|
||||
@draft_version,
|
||||
method: :delete,
|
||||
confirm: true,
|
||||
class: "button hollow alert"
|
||||
) %>
|
||||
</div>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
:destroy,
|
||||
@question,
|
||||
method: :delete,
|
||||
confirm: true,
|
||||
class: "button hollow alert"
|
||||
) %>
|
||||
</div>
|
||||
|
||||
@@ -78,7 +78,10 @@ describe "Admin legislation draft versions", :admin do
|
||||
version = create(:legislation_draft_version, body: "Version 1")
|
||||
|
||||
visit edit_admin_legislation_process_draft_version_path(version.process, version)
|
||||
click_button "Delete"
|
||||
|
||||
accept_confirm("Are you sure? This action will delete \"Version 1\" and can't be undone.") do
|
||||
click_button "Delete"
|
||||
end
|
||||
|
||||
expect(page).to have_content "Draft deleted successfully"
|
||||
end
|
||||
|
||||
@@ -75,7 +75,9 @@ describe "Admin legislation questions", :admin do
|
||||
|
||||
visit edit_admin_legislation_process_question_path(process, question)
|
||||
|
||||
click_button "Delete"
|
||||
accept_confirm("Are you sure? This action will delete \"Question 2\" and can't be undone.") do
|
||||
click_button "Delete"
|
||||
end
|
||||
|
||||
expect(page).to have_content "Questions"
|
||||
expect(page).to have_content "Question 1"
|
||||
|
||||
Reference in New Issue
Block a user