Gestionnaire: move dossier_path gestionnaire_dossier_path

This commit is contained in:
simon lehericey 2018-02-21 14:40:41 +01:00
parent 7bb8849d80
commit 0dc101e375
7 changed files with 18 additions and 18 deletions

View file

@ -72,14 +72,14 @@ module NewGestionnaire
current_gestionnaire.follow(dossier)
flash.notice = 'Dossier passé en instruction.'
redirect_to dossier_path(procedure, dossier)
redirect_to gestionnaire_dossier_path(procedure, dossier)
end
def repasser_en_construction
dossier.en_construction!
flash.notice = 'Dossier repassé en construction.'
redirect_to dossier_path(procedure, dossier)
redirect_to gestionnaire_dossier_path(procedure, dossier)
end
def terminer
@ -118,7 +118,7 @@ module NewGestionnaire
NotificationMailer.send_notification(dossier, template, attestation_pdf).deliver_now!
redirect_to dossier_path(procedure, dossier)
redirect_to gestionnaire_dossier_path(procedure, dossier)
end
def create_commentaire

View file

@ -1,7 +1,7 @@
module DossierLinkHelper
def dossier_linked_path(gestionnaire, dossier)
if dossier.procedure.gestionnaires.include?(gestionnaire)
dossier_path(dossier.procedure, dossier)
gestionnaire_dossier_path(dossier.procedure, dossier)
else
avis = dossier.avis.find_by(gestionnaire: gestionnaire)
if avis.present?

View file

@ -19,10 +19,10 @@
= render partial: "state_button", locals: { dossier: dossier }
%ul.tabs
- notifications_summary = current_gestionnaire.notifications_for_dossier(dossier)
%li{ class: current_page?(dossier_path(dossier.procedure, dossier)) ? 'active' : nil }
%li{ class: current_page?(gestionnaire_dossier_path(dossier.procedure, dossier)) ? 'active' : nil }
- if notifications_summary[:demande]
%span.notifications{ 'aria-label': 'notifications' }
= link_to "Demande", dossier_path(dossier.procedure, dossier)
= link_to "Demande", gestionnaire_dossier_path(dossier.procedure, dossier)
%li{ class: current_page?(annotations_privees_gestionnaire_dossier_path(dossier.procedure, dossier)) ? 'active' : nil }
- if notifications_summary[:annotations_privees]
%span.notifications{ 'aria-label': 'notifications' }

View file

@ -94,22 +94,22 @@
- @dossiers.each do |dossier|
%tr
%td.folder-col
= link_to(dossier_path(@procedure, dossier), class: 'cell-link') do
= link_to(gestionnaire_dossier_path(@procedure, dossier), class: 'cell-link') do
%span.icon.folder
- if current_gestionnaire.notifications_for_procedure(@procedure, :not_archived).include?(dossier.id)
%span.notifications{ 'aria-label': 'notifications' }
%td.number-col
= link_to(dossier_path(@procedure, dossier), class: 'cell-link') do
= link_to(gestionnaire_dossier_path(@procedure, dossier), class: 'cell-link') do
= dossier.id
- @displayed_fields.each do |field|
%td
= link_to(dossier_path(@procedure, dossier), class: 'cell-link') do
= link_to(gestionnaire_dossier_path(@procedure, dossier), class: 'cell-link') do
= dossier.get_value(field['table'], field['column'])
%td.status-col
= link_to(dossier_path(@procedure, dossier), class: 'cell-link') do
= link_to(gestionnaire_dossier_path(@procedure, dossier), class: 'cell-link') do
= render partial: 'status', locals: { dossier: dossier }
%td.follow-col= render partial: 'dossier_actions', locals: { procedure: @procedure, dossier: dossier, dossier_is_followed: @followed_dossiers_id.include?(dossier.id) }
= paginate @dossiers

View file

@ -112,7 +112,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
end
it { expect(dossier.state).to eq('en_instruction') }
it { is_expected.to redirect_to dossier_path(procedure, dossier) }
it { is_expected.to redirect_to gestionnaire_dossier_path(procedure, dossier) }
it { expect(gestionnaire.follow?(dossier)).to be true }
end
@ -131,7 +131,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
expect(dossier.state).to eq('en_construction')
end
it { is_expected.to redirect_to dossier_path(procedure, dossier) }
it { is_expected.to redirect_to gestionnaire_dossier_path(procedure, dossier) }
end
describe '#terminer' do
@ -158,7 +158,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
subject
end
it { is_expected.to redirect_to redirect_to dossier_path(procedure, dossier) }
it { is_expected.to redirect_to redirect_to gestionnaire_dossier_path(procedure, dossier) }
end
context "with classer_sans_suite" do
@ -184,7 +184,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
subject
end
it { is_expected.to redirect_to redirect_to dossier_path(procedure, dossier) }
it { is_expected.to redirect_to redirect_to gestionnaire_dossier_path(procedure, dossier) }
end
context "with accepter" do
@ -233,7 +233,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
it 'Notification email is sent with the attestation' do
subject
is_expected.to redirect_to redirect_to dossier_path(procedure, dossier)
is_expected.to redirect_to redirect_to gestionnaire_dossier_path(procedure, dossier)
end
end
@ -246,7 +246,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
subject
is_expected.to redirect_to redirect_to dossier_path(procedure, dossier)
is_expected.to redirect_to redirect_to gestionnaire_dossier_path(procedure, dossier)
end
end
end

View file

@ -16,7 +16,7 @@ feature 'The gestionnaire part' do
expect(page).to have_current_path(procedure_path(procedure))
click_on dossier.user.email
expect(page).to have_current_path(dossier_path(procedure, dossier))
expect(page).to have_current_path(gestionnaire_dossier_path(procedure, dossier))
click_on 'Passer en instruction'
dossier.reload

View file

@ -13,7 +13,7 @@ describe DossierLinkHelper do
before { dossier.procedure.gestionnaires << gestionnaire }
it { expect(helper.dossier_linked_path(gestionnaire, dossier)).to eq(dossier_path(dossier.procedure, dossier)) }
it { expect(helper.dossier_linked_path(gestionnaire, dossier)).to eq(gestionnaire_dossier_path(dossier.procedure, dossier)) }
end
context "when access as expert" do