Assign values to playoff transition relevant variables in factory

This commit is contained in:
Daniel Schädler 2019-06-11 21:46:02 +02:00
parent 701fc0f357
commit 4783f2067b
1 changed files with 4 additions and 2 deletions

View File

@ -11,8 +11,10 @@ FactoryBot.define do
after(:create) do |tournament, evaluator|
tournament.teams = create_list(:team, evaluator.teams_count, tournament: tournament)
tournament.playoff_teams_amount = (tournament.teams.size / 2)
tournament.instant_finalists_amount = tournament.playoff_teams_amount
tournament.intermediate_round_participants_amount = 0
tournament.instant_finalists_amount = (tournament.playoff_teams_amount / 2)
tournament.intermediate_round_participants_amount = ((tournament.playoff_teams_amount -
tournament.instant_finalists_amount) * 2)
tournament.save!
end
factory :stage_tournament do