Iterate over type_de_champ in repetition type_de_champ

This commit is contained in:
simon lehericey 2020-02-07 15:35:09 +01:00 committed by GitHub Action
parent a62e9fe6d2
commit 4f317e84d1
3 changed files with 28 additions and 0 deletions

View file

@ -153,6 +153,15 @@ FactoryBot.define do
end
end
trait :with_repetition do
after(:build) do |procedure, _evaluator|
type_de_champ = create(:type_de_champ_repetition)
procedure.types_de_champ << type_de_champ
type_de_champ.types_de_champ << create(:type_de_champ, libelle: 'sub type de champ')
end
end
trait :published do
after(:build) do |procedure, _evaluator|
procedure.path = generate(:published_path)