diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index a90788b2ae..b8fc819725 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -15,7 +15,7 @@ class AnnouncementsController < ApplicationController flash[:success] = t(:notice_successful_update) end - render action: 'edit' + redirect_to action: 'edit' end private diff --git a/spec/controllers/announcements_controller_spec.rb b/spec/controllers/announcements_controller_spec.rb index 07a73471e7..fd83bdbb8e 100644 --- a/spec/controllers/announcements_controller_spec.rb +++ b/spec/controllers/announcements_controller_spec.rb @@ -30,7 +30,7 @@ describe AnnouncementsController, type: :controller do end it 'edits the announcement' do - expect(response).to render_template 'edit' + expect(response).to redirect_to action: :edit expect(controller).to set_flash[:success].to I18n.t(:notice_successful_update) end end