summaryrefslogtreecommitdiff
path: root/spec/factories/ci/runners.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/ci/runners.rb')
-rw-r--r--spec/factories/ci/runners.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/factories/ci/runners.rb b/spec/factories/ci/runners.rb
index d0853df4e4b..6665b7b76a0 100644
--- a/spec/factories/ci/runners.rb
+++ b/spec/factories/ci/runners.rb
@@ -11,6 +11,7 @@ FactoryBot.define do
runner_type { :instance_type }
transient do
+ groups { [] }
projects { [] }
end
@@ -18,6 +19,10 @@ FactoryBot.define do
evaluator.projects.each do |proj|
runner.runner_projects << build(:ci_runner_project, project: proj)
end
+
+ evaluator.groups.each do |group|
+ runner.runner_namespaces << build(:ci_runner_namespace, namespace: group)
+ end
end
trait :online do
@@ -32,7 +37,9 @@ FactoryBot.define do
runner_type { :group_type }
after(:build) do |runner, evaluator|
- runner.groups << build(:group) if runner.groups.empty?
+ if runner.runner_namespaces.empty?
+ runner.runner_namespaces << build(:ci_runner_namespace)
+ end
end
end