Dossier on discarded procedure should have access to discarded procedure
This commit is contained in:
parent
bd81970f67
commit
288ace2f34
2 changed files with 11 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
class GroupeInstructeur < ApplicationRecord
|
||||
DEFAULT_LABEL = 'défaut'
|
||||
belongs_to :procedure
|
||||
belongs_to :procedure, -> { with_discarded }, inverse_of: :groupe_instructeurs
|
||||
has_many :assign_tos
|
||||
has_many :instructeurs, through: :assign_tos, dependent: :destroy
|
||||
has_many :dossiers
|
||||
|
|
|
@ -1250,4 +1250,14 @@ describe Dossier do
|
|||
it { expect(Dossier.discarded_brouillon_expired.count).to eq(2) }
|
||||
it { expect(Dossier.discarded_en_construction_expired.count).to eq(2) }
|
||||
end
|
||||
|
||||
describe "discarded procedure dossier should be able to access it's procedure" do
|
||||
let(:dossier) { create(:dossier) }
|
||||
let(:procedure) { dossier.reload.procedure }
|
||||
|
||||
before { dossier.procedure.discard! }
|
||||
|
||||
it { expect(procedure).not_to be_nil }
|
||||
it { expect(procedure.discarded?).to be_truthy }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue