Merge pull request #5141 from tchak/fix-un-archive-when-repasser_en_instruction
Unarchive dossier when repasser_en_instruction
This commit is contained in:
commit
d287942e6c
2 changed files with 3 additions and 1 deletions
|
@ -516,6 +516,7 @@ class Dossier < ApplicationRecord
|
|||
end
|
||||
|
||||
def after_repasser_en_instruction(instructeur)
|
||||
self.archived = false
|
||||
self.processed_at = nil
|
||||
self.motivation = nil
|
||||
attestation&.destroy
|
||||
|
|
|
@ -1056,7 +1056,7 @@ describe Dossier do
|
|||
end
|
||||
|
||||
describe '#repasser_en_instruction!' do
|
||||
let(:dossier) { create(:dossier, :refuse, :with_attestation) }
|
||||
let(:dossier) { create(:dossier, :refuse, :with_attestation, archived: true) }
|
||||
let!(:instructeur) { create(:instructeur) }
|
||||
let(:last_operation) { dossier.dossier_operation_logs.last }
|
||||
|
||||
|
@ -1069,6 +1069,7 @@ describe Dossier do
|
|||
end
|
||||
|
||||
it { expect(dossier.state).to eq('en_instruction') }
|
||||
it { expect(dossier.archived).to be_falsey }
|
||||
it { expect(dossier.processed_at).to be_nil }
|
||||
it { expect(dossier.motivation).to be_nil }
|
||||
it { expect(dossier.attestation).to be_nil }
|
||||
|
|
Loading…
Add table
Reference in a new issue