diff --git a/app/controllers/admin/banners_controller.rb b/app/controllers/admin/banners_controller.rb index 6d154c8d6..c795b4b33 100644 --- a/app/controllers/admin/banners_controller.rb +++ b/app/controllers/admin/banners_controller.rb @@ -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 diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 4ef0cdb33..c6bedf583 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -38,6 +38,8 @@ en: sdg: SDG create: notice: "Banner created successfully" + destroy: + notice: "Banner deleted successfully" edit: editing: Edit banner form: diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index d33daa508..42d446409 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -38,6 +38,8 @@ es: sdg: ODS create: notice: "Banner creado correctamente" + destroy: + notice: "Banner eliminado correctamente" edit: editing: Editar el banner form: diff --git a/spec/system/admin/banners_spec.rb b/spec/system/admin/banners_spec.rb index 67d111acb..e3baf6f86 100644 --- a/spec/system/admin/banners_spec.rb +++ b/spec/system/admin/banners_spec.rb @@ -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