diff --git a/spec/factories/stages.rb b/spec/factories/stages.rb index 168acb6..13c2e65 100644 --- a/spec/factories/stages.rb +++ b/spec/factories/stages.rb @@ -16,12 +16,15 @@ FactoryBot.define do factory :playoff_stage do level { rand(10) } transient do + match_state { :not_started } match_count { 4 } end after(:create) do |stage, evaluator| # match_count -1 automatically generates 2 ^ stage.level matches # (as this would be the amount of stages present in the real world) - stage.matches = create_list(:match, evaluator.match_count == -1 ? 2**stage.level : evaluator.match_count) + stage.matches = create_list(:running_playoff_match, + evaluator.match_count == -1 ? 2**stage.level : evaluator.match_count, + state: evaluator.match_state) stage.matches.each_with_index { |match, i| match.position = i } end end