Improve the Procedure factory
We can now specify how many types_de_champ a procedure has
This commit is contained in:
parent
b820f9d39c
commit
0cc5d85f13
1 changed files with 9 additions and 3 deletions
|
@ -30,12 +30,18 @@ FactoryGirl.define do
|
||||||
end
|
end
|
||||||
|
|
||||||
trait :with_type_de_champ do
|
trait :with_type_de_champ do
|
||||||
after(:build) do |procedure, _evaluator|
|
transient do
|
||||||
|
types_de_champ_count 1
|
||||||
|
end
|
||||||
|
|
||||||
|
after(:build) do |procedure, evaluator|
|
||||||
|
evaluator.types_de_champ_count.times do
|
||||||
type_de_champ = create(:type_de_champ_public)
|
type_de_champ = create(:type_de_champ_public)
|
||||||
|
|
||||||
procedure.types_de_champ << type_de_champ
|
procedure.types_de_champ << type_de_champ
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
trait :with_type_de_champ_private do
|
trait :with_type_de_champ_private do
|
||||||
after(:build) do |procedure, _evaluator|
|
after(:build) do |procedure, _evaluator|
|
||||||
|
|
Loading…
Reference in a new issue