For stage tournament, first stage has running matches
This commit is contained in:
parent
bfaa270808
commit
0233ecab2c
|
|
@ -18,9 +18,14 @@ FactoryBot.define do
|
||||||
end
|
end
|
||||||
after(:create) do |tournament, evaluator|
|
after(:create) do |tournament, evaluator|
|
||||||
# this is basically a manual create_list as we need to count up the level of the stage
|
# this is basically a manual create_list as we need to count up the level of the stage
|
||||||
tournament.stages.concat 1..evaluator.stage_count.map do |level|
|
levels = 1..evaluator.stage_count
|
||||||
create(:playoff_stage, level: level, match_count: -1)
|
tournament.stages.concat levels
|
||||||
end
|
.map { |level|
|
||||||
|
create(:playoff_stage,
|
||||||
|
level: level,
|
||||||
|
match_count: -1,
|
||||||
|
match_state: level == evaluator.stage_count ? :in_progress : :not_started)
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
factory :group_stage_tournament do
|
factory :group_stage_tournament do
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue