Add :undecided_group_match and :decided_playoff_match
This commit is contained in:
parent
a480cf3180
commit
002f59ecd8
|
|
@ -10,7 +10,18 @@ FactoryBot.define do
|
||||||
after(:create) do |match, evaluator|
|
after(:create) do |match, evaluator|
|
||||||
match.match_scores = create_list(:match_score, evaluator.match_scores_count)
|
match.match_scores = create_list(:match_score, evaluator.match_scores_count)
|
||||||
end
|
end
|
||||||
state { 3 }
|
state { :in_progress }
|
||||||
|
end
|
||||||
|
|
||||||
|
factory :decided_playoff_match do
|
||||||
|
transient do
|
||||||
|
match_scores_count { 2 }
|
||||||
|
end
|
||||||
|
after(:create) do |match, evaluator|
|
||||||
|
match.match_scores = create_list(:match_score, evaluator.match_scores_count, points: rand(10))
|
||||||
|
match.match_scores.first.points += 1
|
||||||
|
end
|
||||||
|
state { :finished }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -23,7 +34,17 @@ FactoryBot.define do
|
||||||
after(:create) do |match, evaluator|
|
after(:create) do |match, evaluator|
|
||||||
match.match_scores = create_list(:match_score, evaluator.match_scores_count)
|
match.match_scores = create_list(:match_score, evaluator.match_scores_count)
|
||||||
end
|
end
|
||||||
state { 3 }
|
state { :in_progress }
|
||||||
|
end
|
||||||
|
|
||||||
|
factory :undecided_group_match do
|
||||||
|
transient do
|
||||||
|
match_scores_count { 2 }
|
||||||
|
end
|
||||||
|
after(:create) do |match, evaluator|
|
||||||
|
match.match_scores = create_list(:match_score, evaluator.match_scores_count, points: 3)
|
||||||
|
end
|
||||||
|
state { :finished }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue