Gestionnaire: move instruction_avis_path to instruction_gestionnaire_avis_path

This commit is contained in:
simon lehericey 2018-02-21 13:42:12 +01:00
parent bdce6aff2e
commit c58b32a26d
4 changed files with 7 additions and 7 deletions

View file

@ -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

View file

@ -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 }

View file

@ -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

View file

@ -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}")