Add group_stage_only_tournament factory

This commit is contained in:
Daniel Schädler 2019-05-10 23:13:12 +02:00
parent eea1bbde12
commit a7a02dac57
1 changed files with 9 additions and 0 deletions

View File

@ -12,6 +12,15 @@ FactoryBot.define do
tournament.teams = create_list(:team, evaluator.teams_count, tournament: tournament)
end
factory :group_stage_only_tournament do
transient do
group_count { 2 }
end
after(:create) do |tournament, evaluator|
tournament.stages.concat create_list(:group_stage, 1, group_count: evaluator.group_count)
end
end
factory :stage_tournament do
transient do
stage_count { 1 }