link children tdc by ProcedureRevisionTypeDeChamp
This commit is contained in:
parent
ce0a592f3c
commit
64175db4dd
1 changed files with 11 additions and 2 deletions
|
@ -188,8 +188,17 @@ FactoryBot.define do
|
|||
end
|
||||
|
||||
trait :with_types_de_champ do
|
||||
after(:build) do |type_de_champ, _evaluator|
|
||||
build(:type_de_champ, libelle: 'sub type de champ', parent: type_de_champ)
|
||||
after(:build) do |type_de_champ, evaluator|
|
||||
tdc = build(:type_de_champ, libelle: 'sub type de champ', parent: type_de_champ)
|
||||
|
||||
evaluator.procedure.save
|
||||
|
||||
ProcedureRevisionTypeDeChamp.create!(
|
||||
revision_id: evaluator.procedure.active_revision.id,
|
||||
type_de_champ_id: tdc.id,
|
||||
parent_id: tdc.parent.revision_type_de_champ.id,
|
||||
position: 0
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue