[#1110] Make processed_at date available for attestation generation
This commit is contained in:
parent
4805e4a5b2
commit
6a85094e1a
4 changed files with 12 additions and 4 deletions
|
@ -123,8 +123,8 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
|
|||
notice = "Dossier considéré comme sans suite."
|
||||
template = dossier.procedure.without_continuation_mail_template
|
||||
when "close"
|
||||
dossier.attestation = dossier.build_attestation
|
||||
dossier.accepte!
|
||||
dossier.attestation = dossier.build_attestation
|
||||
notice = "Dossier traité avec succès."
|
||||
template = dossier.procedure.closed_mail_template
|
||||
end
|
||||
|
|
|
@ -89,8 +89,8 @@ module NewGestionnaire
|
|||
notice = "Dossier considéré comme sans suite."
|
||||
template = procedure.without_continuation_mail_template
|
||||
when "accepter"
|
||||
dossier.attestation = dossier.build_attestation
|
||||
dossier.accepte!
|
||||
dossier.attestation = dossier.build_attestation
|
||||
notice = "Dossier traité avec succès."
|
||||
template = procedure.closed_mail_template
|
||||
end
|
||||
|
|
|
@ -358,11 +358,15 @@ describe Backoffice::DossiersController, type: :controller do
|
|||
subject { post :process_dossier, params: { process_action: "close", dossier_id: dossier_id, dossier: { motivation: "Yallah" }}}
|
||||
|
||||
before do
|
||||
Timecop.freeze(DateTime.now)
|
||||
|
||||
expect_any_instance_of(AttestationTemplate)
|
||||
.to receive(:attestation_for)
|
||||
.with(have_attributes(motivation: "Yallah"))
|
||||
.with(have_attributes(motivation: "Yallah", processed_at: DateTime.now))
|
||||
end
|
||||
|
||||
after { Timecop.return }
|
||||
|
||||
it { subject }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -237,11 +237,15 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
|||
end
|
||||
|
||||
before do
|
||||
Timecop.freeze(DateTime.now)
|
||||
|
||||
expect_any_instance_of(AttestationTemplate)
|
||||
.to receive(:attestation_for)
|
||||
.with(have_attributes(motivation: "Yallah"))
|
||||
.with(have_attributes(motivation: "Yallah", processed_at: DateTime.now))
|
||||
end
|
||||
|
||||
after { Timecop.return }
|
||||
|
||||
it { subject }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue