From 34159f7e014fcafd25e5e61004da1ee511c17969 Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Thu, 29 Nov 2018 11:01:17 +0100 Subject: [PATCH] Add a running playoff Match to Match Factory --- spec/factories/matches.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/spec/factories/matches.rb b/spec/factories/matches.rb index 5c8b5a6..b35703d 100644 --- a/spec/factories/matches.rb +++ b/spec/factories/matches.rb @@ -1,8 +1,17 @@ # frozen_string_literal: true FactoryBot.define do - factory :stage_match, aliases: [:match], class: Match do + factory :playoff_match, aliases: [:match], class: Match do stage + factory :running_playoff_match do + transient do + scores_count { 2 } + end + after(:create) do |match, evaluator| + match.scores = create_list(:score, evaluator.scores_count) + end + state { 3 } + end end factory :group_match, class: Match do