diff options
Diffstat (limited to 'spec/factories/pool_repositories.rb')
-rw-r--r-- | spec/factories/pool_repositories.rb | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/spec/factories/pool_repositories.rb b/spec/factories/pool_repositories.rb index 2ed0844ed47..265a4643f46 100644 --- a/spec/factories/pool_repositories.rb +++ b/spec/factories/pool_repositories.rb @@ -1,5 +1,26 @@ FactoryBot.define do factory :pool_repository do - shard + shard { Shard.by_name("default") } + state :none + + before(:create) do |pool| + pool.source_project = create(:project, :repository) + end + + trait :scheduled do + state :scheduled + end + + trait :failed do + state :failed + end + + trait :ready do + state :ready + + after(:create) do |pool| + pool.create_object_pool + end + end end end |