diff --git a/spec/factories/matches.rb b/spec/factories/matches.rb index 43fb55d..e7ebed8 100644 --- a/spec/factories/matches.rb +++ b/spec/factories/matches.rb @@ -34,13 +34,10 @@ FactoryBot.define do factory :group_match, class: Match do group position { 0 } + transient do + match_scores_count { 2 } + end 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 } end @@ -53,5 +50,9 @@ FactoryBot.define do end state { :finished } end + + after(:create) do |match, evaluator| + match.match_scores = create_list(:match_score, evaluator.match_scores_count) + end end end