diff --git a/spec/factories/tournaments.rb b/spec/factories/tournaments.rb index 2360ff9..1e73fcd 100644 --- a/spec/factories/tournaments.rb +++ b/spec/factories/tournaments.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true FactoryBot.define do - factory :tournament do + factory :tournament, aliases: [:stageless_tournament] do name { Faker::Creature::Dog.name } description { Faker::Lorem.sentence } user @@ -38,5 +38,14 @@ FactoryBot.define do end end end + + factory :dummy_stage_tournament do + transient do + stage_count { 3 } + end + after(:create) do |tournament, evaluator| + tournament.stages.concat create_list(:stage, evaluator.stage_count) + end + end end end