Ask confirmation to delete content blocks from the edit page
We were already doing that when deleting content blocks from the index page, and we also ask for confirmation in almost every page in the admin section.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
@content_block,
|
||||
text: t("admin.site_customization.content_blocks.index.delete"),
|
||||
path: (@is_heading_content_block ? admin_site_customization_delete_heading_content_block_path(@content_block.id) : admin_site_customization_content_block_path(@content_block)),
|
||||
confirm: true,
|
||||
method: :delete,
|
||||
class: "delete float-right"
|
||||
) %>
|
||||
|
||||
@@ -103,7 +103,9 @@ describe "Admin custom content blocks", :admin do
|
||||
block = create(:site_customization_content_block)
|
||||
visit edit_admin_site_customization_content_block_path(block)
|
||||
|
||||
accept_confirm("Are you sure? This action will delete \"#{block.name}\" and can't be undone.") do
|
||||
click_button "Delete block"
|
||||
end
|
||||
|
||||
expect(page).not_to have_content("#{block.name} (#{block.locale})")
|
||||
expect(page).not_to have_content(block.body)
|
||||
|
||||
Reference in New Issue
Block a user