Merge pull request #2304 from betagouv/fix_sentry_2755
Fix Sentry error 2755
This commit is contained in:
commit
87dcec9908
2 changed files with 12 additions and 2 deletions
|
@ -101,8 +101,10 @@ module NewGestionnaire
|
|||
NotificationMailer.send_without_continuation_notification(dossier).deliver_later
|
||||
when "accepter"
|
||||
dossier.accepte!
|
||||
dossier.attestation = dossier.build_attestation
|
||||
dossier.save
|
||||
if dossier.attestation.nil?
|
||||
dossier.attestation = dossier.build_attestation
|
||||
dossier.save
|
||||
end
|
||||
flash.notice = "Dossier traité avec succès."
|
||||
NotificationMailer.send_closed_notification(dossier).deliver_later
|
||||
end
|
||||
|
|
|
@ -227,6 +227,14 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
|||
|
||||
is_expected.to redirect_to redirect_to gestionnaire_dossier_path(procedure, dossier)
|
||||
end
|
||||
|
||||
context 'and the dossier has already an attestation' do
|
||||
it 'should not crash' do
|
||||
dossier.attestation = Attestation.new
|
||||
dossier.save
|
||||
expect(subject).to redirect_to redirect_to gestionnaire_dossier_path(procedure, dossier)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the attestation template uses the motivation field' do
|
||||
|
|
Loading…
Reference in a new issue