models: require belong_to associations on attestation_template
This commit is contained in:
parent
1ea4c2aa36
commit
aefdd5d2a1
4 changed files with 6 additions and 4 deletions
|
@ -4,6 +4,8 @@ FactoryBot.define do
|
|||
body { 'body' }
|
||||
footer { 'footer' }
|
||||
activated { true }
|
||||
|
||||
association :procedure
|
||||
end
|
||||
|
||||
trait :with_files do
|
||||
|
|
|
@ -183,9 +183,9 @@ FactoryBot.define do
|
|||
end
|
||||
|
||||
trait :with_attestation do
|
||||
after(:create) do |dossier, _evaluator|
|
||||
after(:build) do |dossier, _evaluator|
|
||||
if dossier.procedure.attestation_template.blank?
|
||||
dossier.procedure.attestation_template = create(:attestation_template)
|
||||
dossier.procedure.attestation_template = build(:attestation_template)
|
||||
end
|
||||
dossier.attestation = dossier.build_attestation
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue