Merge pull request #4848 from consul/banner_destroy_notice
Add notice after destroying a banner
This commit is contained in:
@@ -32,7 +32,7 @@ class Admin::BannersController < Admin::BaseController
|
||||
|
||||
def destroy
|
||||
@banner.destroy!
|
||||
redirect_to admin_banners_path
|
||||
redirect_to admin_banners_path, notice: t("admin.banners.destroy.notice")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -38,6 +38,8 @@ en:
|
||||
sdg: SDG
|
||||
create:
|
||||
notice: "Banner created successfully"
|
||||
destroy:
|
||||
notice: "Banner deleted successfully"
|
||||
edit:
|
||||
editing: Edit banner
|
||||
form:
|
||||
|
||||
@@ -38,6 +38,8 @@ es:
|
||||
sdg: ODS
|
||||
create:
|
||||
notice: "Banner creado correctamente"
|
||||
destroy:
|
||||
notice: "Banner eliminado correctamente"
|
||||
edit:
|
||||
editing: Editar el banner
|
||||
form:
|
||||
|
||||
@@ -177,6 +177,8 @@ describe "Admin banners magement", :admin do
|
||||
click_button "Delete"
|
||||
end
|
||||
|
||||
expect(page).to have_content "Banner deleted successfully"
|
||||
|
||||
visit admin_root_path
|
||||
expect(page).not_to have_content "Ugly banner"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user