Add dummy_stage_tournament
This commit is contained in:
parent
05a35557db
commit
a6c46c48d5
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
FactoryBot.define do
|
||||
factory :tournament do
|
||||
factory :tournament, aliases: [:stage_less_tournament] do
|
||||
name { Faker::Creature::Dog.name }
|
||||
description { Faker::Lorem.sentence }
|
||||
user
|
||||
|
|
@ -34,5 +34,14 @@ FactoryBot.define do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
factory :dummy_stage_tournament do
|
||||
transient do
|
||||
stage_count { 3 }
|
||||
end
|
||||
after(:create) do |tournament, evaluator|
|
||||
tournament.stages.concat create_list(:stage, evaluator.stage_count)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue