diff --git a/app/controllers/admin/mail_templates_controller.rb b/app/controllers/admin/mail_templates_controller.rb index bc7c948ff..3ed7f277d 100644 --- a/app/controllers/admin/mail_templates_controller.rb +++ b/app/controllers/admin/mail_templates_controller.rb @@ -12,7 +12,8 @@ class Admin::MailTemplatesController < AdminController def update mail_template = find_mail_template_by_slug(params[:id]) mail_template.update(update_params) - redirect_to admin_procedure_mail_templates_path + flash.notice = "Email mis à jour" + redirect_to edit_admin_procedure_mail_template_path(mail_template.procedure_id, params[:id]) end private diff --git a/spec/controllers/admin/mail_templates_controller_spec.rb b/spec/controllers/admin/mail_templates_controller_spec.rb index e9c35576f..d34ef2684 100644 --- a/spec/controllers/admin/mail_templates_controller_spec.rb +++ b/spec/controllers/admin/mail_templates_controller_spec.rb @@ -31,7 +31,7 @@ describe Admin::MailTemplatesController, type: :controller do } end - it { expect(response).to redirect_to admin_procedure_mail_templates_path(procedure) } + it { expect(response).to redirect_to edit_admin_procedure_mail_template_path(procedure, initiated_mail.class.const_get(:SLUG)) } context 'the mail template' do subject { procedure.reload; procedure.initiated_mail_template }