Improve the names of some parameters in DossiersController

This commit is contained in:
gregoirenovel 2017-11-30 17:29:26 +01:00
parent 684dafb6d4
commit dd47f96424
3 changed files with 12 additions and 12 deletions

View file

@ -74,15 +74,15 @@ module NewGestionnaire
end
case params[:process_action]
when "refuse"
when "refuser"
next_step = "refuse"
notice = "Dossier considéré comme refusé."
template = procedure.refused_mail_template
when "without_continuation"
when "classer_sans_suite"
next_step = "without_continuation"
notice = "Dossier considéré comme sans suite."
template = procedure.without_continuation_mail_template
when "close"
when "accepter"
next_step = "close"
notice = "Dossier traité avec succès."
template = procedure.closed_mail_template

View file

@ -43,9 +43,9 @@
.description
%h4 Refuser
L'usager sera notifié que son dossier a été refusé
= render partial: 'new_gestionnaire/dossiers/state_button_motivation', locals: { dossier: dossier, popup_title: 'Accepter le dossier', popup_class: 'accept', process_action: 'close', title: 'Accepter', confirm: 'Accepter ce dossier ?' }
= render partial: 'new_gestionnaire/dossiers/state_button_motivation', locals: { dossier: dossier, popup_title: 'Classer le dossier sans suite', popup_class: 'without-continuation', process_action: 'without_continuation', title: 'Classer sans suite', confirm: 'Confirmer vous le classement sans suite de ce dossier ?' }
= render partial: 'new_gestionnaire/dossiers/state_button_motivation', locals: { dossier: dossier, popup_title: 'Refuser le dossier', popup_class: 'close', process_action: 'refuse', title: 'Refuser', confirm: 'Confirmer vous le refus de ce dossier ?' }
= render partial: 'new_gestionnaire/dossiers/state_button_motivation', locals: { dossier: dossier, popup_title: 'Accepter le dossier', popup_class: 'accept', process_action: 'accepter', title: 'Accepter', confirm: 'Accepter ce dossier ?' }
= render partial: 'new_gestionnaire/dossiers/state_button_motivation', locals: { dossier: dossier, popup_title: 'Classer le dossier sans suite', popup_class: 'without-continuation', process_action: 'classer_sans_suite', title: 'Classer sans suite', confirm: 'Confirmer vous le classement sans suite de ce dossier ?' }
= render partial: 'new_gestionnaire/dossiers/state_button_motivation', locals: { dossier: dossier, popup_title: 'Refuser le dossier', popup_class: 'close', process_action: 'refuser', title: 'Refuser', confirm: 'Confirmer vous le refus de ce dossier ?' }
- else
- if dossier.motivation.present? || dossier.attestation.present?

View file

@ -109,13 +109,13 @@ describe NewGestionnaire::DossiersController, type: :controller do
end
describe '#terminer' do
context "with refuse" do
context "with refuser" do
before do
dossier.received!
sign_in gestionnaire
end
subject { post :terminer, params: { process_action: "refuse", procedure_id: procedure.id, dossier_id: dossier.id} }
subject { post :terminer, params: { process_action: "refuser", procedure_id: procedure.id, dossier_id: dossier.id} }
it 'change state to refused' do
subject
@ -135,13 +135,13 @@ describe NewGestionnaire::DossiersController, type: :controller do
it { is_expected.to redirect_to redirect_to dossier_path(procedure, dossier) }
end
context "with without_continuation" do
context "with classer_sans_suite" do
before do
dossier.received!
sign_in gestionnaire
end
subject { post :terminer, params: { process_action: "without_continuation", procedure_id: procedure.id, dossier_id: dossier.id} }
subject { post :terminer, params: { process_action: "classer_sans_suite", procedure_id: procedure.id, dossier_id: dossier.id} }
it 'change state to without_continuation' do
subject
@ -161,7 +161,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
it { is_expected.to redirect_to redirect_to dossier_path(procedure, dossier) }
end
context "with close" do
context "with accepter" do
let(:expected_attestation) { nil }
before do
@ -175,7 +175,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
expect(NotificationMailer).to receive(:deliver_now!)
end
subject { post :terminer, params: { process_action: "close", procedure_id: procedure.id, dossier_id: dossier.id} }
subject { post :terminer, params: { process_action: "accepter", procedure_id: procedure.id, dossier_id: dossier.id} }
it 'change state to closed' do
subject