From a710addde7ddc21e873b36b5598c3058536ca608 Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Sun, 26 May 2019 22:03:22 +0200 Subject: [PATCH] Create :stage_tournaments with realistic match positions --- spec/factories/tournaments.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/factories/tournaments.rb b/spec/factories/tournaments.rb index 6d7098e..626a552 100644 --- a/spec/factories/tournaments.rb +++ b/spec/factories/tournaments.rb @@ -34,6 +34,12 @@ FactoryBot.define do match_count: -1, match_type: evaluator.stage_count ? :running_playoff_match : :empty_prepared_playoff_match ) + tournament.stages.each do |stage| + stage.matches.each_with_index do |match, i| + match.position = i + match.save! + end + end end end