From edb030bb4c5dfe23e48b75eaebfbf0c0ad6a94b9 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Wed, 13 Sep 2023 13:06:07 +0200 Subject: [PATCH] refactor(exports): regenerating exports redirect (back) to exports page Co-Authored-By: Lisa Durand --- app/controllers/instructeurs/procedures_controller.rb | 2 +- spec/controllers/instructeurs/procedures_controller_spec.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/instructeurs/procedures_controller.rb b/app/controllers/instructeurs/procedures_controller.rb index 1f08f7215..69d37c755 100644 --- a/app/controllers/instructeurs/procedures_controller.rb +++ b/app/controllers/instructeurs/procedures_controller.rb @@ -194,7 +194,7 @@ module Instructeurs end end format.html do - redirect_to instructeur_procedure_url(procedure), notice: export.flash_message + redirect_to exports_instructeur_procedure_path(procedure), notice: export.flash_message end end end diff --git a/spec/controllers/instructeurs/procedures_controller_spec.rb b/spec/controllers/instructeurs/procedures_controller_spec.rb index 83d803701..f5cd4bf24 100644 --- a/spec/controllers/instructeurs/procedures_controller_spec.rb +++ b/spec/controllers/instructeurs/procedures_controller_spec.rb @@ -588,7 +588,7 @@ describe Instructeurs::ProceduresController, type: :controller do context 'when the export does not exist' do it 'displays an notice' do - is_expected.to redirect_to(instructeur_procedure_url(procedure)) + is_expected.to redirect_to(exports_instructeur_procedure_url(procedure)) expect(flash.notice).to be_present end @@ -601,7 +601,7 @@ describe Instructeurs::ProceduresController, type: :controller do end it 'displays an notice' do - is_expected.to redirect_to(instructeur_procedure_url(procedure)) + is_expected.to redirect_to(exports_instructeur_procedure_url(procedure)) expect(flash.notice).to be_present end end @@ -627,7 +627,7 @@ describe Instructeurs::ProceduresController, type: :controller do end it 'displays an notice' do - is_expected.to redirect_to(instructeur_procedure_url(procedure)) + is_expected.to redirect_to(exports_instructeur_procedure_url(procedure)) expect(flash.notice).to be_present end end