Add dummy_stage_tournament

This commit is contained in:
Daniel Schädler 2019-05-10 18:30:13 +02:00
parent 05a35557db
commit a6c46c48d5
1 changed files with 10 additions and 1 deletions

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
FactoryBot.define do FactoryBot.define do
factory :tournament do factory :tournament, aliases: [:stage_less_tournament] do
name { Faker::Creature::Dog.name } name { Faker::Creature::Dog.name }
description { Faker::Lorem.sentence } description { Faker::Lorem.sentence }
user user
@ -34,5 +34,14 @@ FactoryBot.define do
end end
end end
end end
factory :dummy_stage_tournament do
transient do
stage_count { 3 }
end
after(:create) do |tournament, evaluator|
tournament.stages.concat create_list(:stage, evaluator.stage_count)
end
end
end end
end end