A group_match always has match_scores attached
This commit is contained in:
parent
d50cd66b24
commit
dabddd6702
|
|
@ -34,13 +34,10 @@ FactoryBot.define do
|
||||||
factory :group_match, class: Match do
|
factory :group_match, class: Match do
|
||||||
group
|
group
|
||||||
position { 0 }
|
position { 0 }
|
||||||
|
transient do
|
||||||
|
match_scores_count { 2 }
|
||||||
|
end
|
||||||
factory :running_group_match do
|
factory :running_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)
|
|
||||||
end
|
|
||||||
state { :in_progress }
|
state { :in_progress }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -53,5 +50,9 @@ FactoryBot.define do
|
||||||
end
|
end
|
||||||
state { :finished }
|
state { :finished }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
after(:create) do |match, evaluator|
|
||||||
|
match.match_scores = create_list(:match_score, evaluator.match_scores_count)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue