diff --git a/app/controllers/admin/banners_controller.rb b/app/controllers/admin/banners_controller.rb index afbf009f4..05e882afb 100644 --- a/app/controllers/admin/banners_controller.rb +++ b/app/controllers/admin/banners_controller.rb @@ -16,7 +16,7 @@ class Admin::BannersController < Admin::BaseController def create @banner = Banner.new(banner_params) if @banner.save - redirect_to admin_banners_path + redirect_to admin_banners_path, notice: t("admin.banners.create.notice") else render :new end @@ -24,7 +24,7 @@ class Admin::BannersController < Admin::BaseController def update if @banner.update(banner_params) - redirect_to admin_banners_path + redirect_to admin_banners_path, notice: t("admin.banners.update.notice") else render :edit end diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 85a5ed4b4..c101d1bb3 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -36,12 +36,16 @@ en: budgets: Participatory budgeting help_page: Help page sdg: SDG + create: + notice: "Banner created successfully" edit: editing: Edit banner form: submit_button: Save changes new: creating: Create banner + update: + notice: "Banner updated successfully" activity: show: action: Action diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index c6cab0bef..fe424a138 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -36,12 +36,16 @@ es: budgets: Presupuestos participativos help_page: Página de ayuda sdg: ODS + create: + notice: "Banner creado correctamente" edit: editing: Editar el banner form: submit_button: Guardar cambios new: creating: Crear banner + update: + notice: "Banner actualizado correctamente" activity: show: action: Acción diff --git a/spec/system/admin/banners_spec.rb b/spec/system/admin/banners_spec.rb index a1e1b0db3..7ad63ee61 100644 --- a/spec/system/admin/banners_spec.rb +++ b/spec/system/admin/banners_spec.rb @@ -88,7 +88,7 @@ describe "Admin banners magement", :admin do click_button "Save changes" - expect(page).to have_content "Such banner" + expect(page).to have_content "Banner created successfully" visit proposals_path @@ -158,7 +158,8 @@ describe "Admin banners magement", :admin do click_button "Save changes" - visit admin_banners_path + expect(page).to have_content "Banner updated successfully" + expect(page).to have_content "Modified title" expect(page).to have_content "Edited text"