summaryrefslogtreecommitdiff
path: root/spec/factories/ci/runner_projects.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/ci/runner_projects.rb')
-rw-r--r--spec/factories/ci/runner_projects.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/factories/ci/runner_projects.rb b/spec/factories/ci/runner_projects.rb
index ead9fe10f6e..31536275ff4 100644
--- a/spec/factories/ci/runner_projects.rb
+++ b/spec/factories/ci/runner_projects.rb
@@ -2,7 +2,14 @@
FactoryBot.define do
factory :ci_runner_project, class: 'Ci::RunnerProject' do
- runner factory: [:ci_runner, :project]
project
+
+ after(:build) do |runner_project, evaluator|
+ unless runner_project.runner.present?
+ runner_project.runner = build(
+ :ci_runner, :project, runner_projects: [runner_project]
+ )
+ end
+ end
end
end