diff --git a/app/controllers/new_gestionnaire/avis_controller.rb b/app/controllers/new_gestionnaire/avis_controller.rb index 9bb562ba5..a240178ae 100644 --- a/app/controllers/new_gestionnaire/avis_controller.rb +++ b/app/controllers/new_gestionnaire/avis_controller.rb @@ -34,7 +34,7 @@ module NewGestionnaire def update avis.update_attributes(avis_params) flash.notice = 'Votre réponse est enregistrée.' - redirect_to instruction_avis_path(avis) + redirect_to instruction_gestionnaire_avis_path(avis) end def messagerie @@ -56,7 +56,7 @@ module NewGestionnaire def create_avis confidentiel = avis.confidentiel || params[:avis][:confidentiel] Avis.create(create_avis_params.merge(claimant: current_gestionnaire, dossier: avis.dossier, confidentiel: confidentiel)) - redirect_to instruction_avis_path(avis) + redirect_to instruction_gestionnaire_avis_path(avis) end def sign_up diff --git a/app/views/new_gestionnaire/avis/_header.html.haml b/app/views/new_gestionnaire/avis/_header.html.haml index a801eb5b9..05ae187b7 100644 --- a/app/views/new_gestionnaire/avis/_header.html.haml +++ b/app/views/new_gestionnaire/avis/_header.html.haml @@ -7,8 +7,8 @@ %ul.tabs %li{ class: current_page?(avis_path(avis)) ? 'active' : nil } = link_to 'Demande', avis_path(avis) - %li{ class: current_page?(instruction_avis_path(avis)) ? 'active' : nil } - = link_to 'Avis', instruction_avis_path(avis) + %li{ class: current_page?(instruction_gestionnaire_avis_path(avis)) ? 'active' : nil } + = link_to 'Avis', instruction_gestionnaire_avis_path(avis) - if avis.answer == nil %span.notifications{ 'aria-label': 'notifications' } %li{ class: current_page?(messagerie_avis_path(avis)) ? 'active' : nil } diff --git a/spec/controllers/new_gestionnaire/avis_controller_spec.rb b/spec/controllers/new_gestionnaire/avis_controller_spec.rb index a7a94700e..5f5bf959d 100644 --- a/spec/controllers/new_gestionnaire/avis_controller_spec.rb +++ b/spec/controllers/new_gestionnaire/avis_controller_spec.rb @@ -58,7 +58,7 @@ describe NewGestionnaire::AvisController, type: :controller do avis_without_answer.reload end - it { expect(response).to redirect_to(instruction_avis_path(avis_without_answer)) } + it { expect(response).to redirect_to(instruction_gestionnaire_avis_path(avis_without_answer)) } it { expect(avis_without_answer.answer).to eq('answer') } it { expect(flash.notice).to eq('Votre réponse est enregistrée.') } end @@ -119,7 +119,7 @@ describe NewGestionnaire::AvisController, type: :controller do it { expect(created_avis.introduction).to eq(intro) } it { expect(created_avis.dossier).to eq(previous_avis.dossier) } it { expect(created_avis.claimant).to eq(gestionnaire) } - it { expect(response).to redirect_to(instruction_avis_path(previous_avis)) } + it { expect(response).to redirect_to(instruction_gestionnaire_avis_path(previous_avis)) } end context 'when the user asked for a confidentiel avis' do diff --git a/spec/features/new_gestionnaire/gestionnaire_spec.rb b/spec/features/new_gestionnaire/gestionnaire_spec.rb index a2a59d601..a6f633bd3 100644 --- a/spec/features/new_gestionnaire/gestionnaire_spec.rb +++ b/spec/features/new_gestionnaire/gestionnaire_spec.rb @@ -85,7 +85,7 @@ feature 'The gestionnaire part' do within(:css, '.tabs') do click_on 'Avis' end - expect(page).to have_current_path(instruction_avis_path(dossier.avis.first)) + expect(page).to have_current_path(instruction_gestionnaire_avis_path(dossier.avis.first)) within(:css, '.give-avis') do expect(page).to have_text("Demandeur : #{gestionnaire.email}")