From 43b3d2dfe8d80da5257a045c2aa04a38c4bb0b03 Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Fri, 10 May 2019 23:13:12 +0200 Subject: [PATCH] Add group_stage_only_tournament factory --- spec/factories/tournaments.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/factories/tournaments.rb b/spec/factories/tournaments.rb index 3e5022e..22cf099 100644 --- a/spec/factories/tournaments.rb +++ b/spec/factories/tournaments.rb @@ -12,6 +12,15 @@ FactoryBot.define do tournament.teams = create_list(:team, evaluator.teams_count, tournament: tournament) end + factory :group_stage_only_tournament do + transient do + group_count { 2 } + end + after(:create) do |tournament, evaluator| + tournament.stages.concat create_list(:group_stage, 1, group_count: evaluator.group_count) + end + end + factory :stage_tournament do transient do stage_count { 1 }