Add dummy_stage_tournament
This commit is contained in:
parent
c55b45bdc1
commit
3f4c6336c2
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
FactoryBot.define do
|
FactoryBot.define do
|
||||||
factory :tournament do
|
factory :tournament, aliases: [:stageless_tournament] do
|
||||||
name { Faker::Creature::Dog.name }
|
name { Faker::Creature::Dog.name }
|
||||||
description { Faker::Lorem.sentence }
|
description { Faker::Lorem.sentence }
|
||||||
user
|
user
|
||||||
|
|
@ -38,5 +38,14 @@ FactoryBot.define do
|
||||||
end
|
end
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue