Add default for playoff_teams_amount to tournament factory

This commit is contained in:
Daniel Schädler 2019-06-10 20:13:43 +02:00
parent f04c11427a
commit 36bdfbae28
1 changed files with 1 additions and 0 deletions

View File

@ -10,6 +10,7 @@ FactoryBot.define do
end end
after(:create) do |tournament, evaluator| after(:create) do |tournament, evaluator|
tournament.teams = create_list(:team, evaluator.teams_count, tournament: tournament) tournament.teams = create_list(:team, evaluator.teams_count, tournament: tournament)
tournament.playoff_teams_amount = (tournament.teams.size / 2)
end end
factory :stage_tournament do factory :stage_tournament do