Add a running playoff Match to Match Factory
This commit is contained in:
parent
fbb87f5f7c
commit
34159f7e01
|
|
@ -1,8 +1,17 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
FactoryBot.define do
|
FactoryBot.define do
|
||||||
factory :stage_match, aliases: [:match], class: Match do
|
factory :playoff_match, aliases: [:match], class: Match do
|
||||||
stage
|
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
|
end
|
||||||
|
|
||||||
factory :group_match, class: Match do
|
factory :group_match, class: Match do
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue