summaryrefslogtreecommitdiff
path: root/spec/factories/ci/bridge.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/ci/bridge.rb')
-rw-r--r--spec/factories/ci/bridge.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/factories/ci/bridge.rb b/spec/factories/ci/bridge.rb
index b1d82b98411..b1b714277e4 100644
--- a/spec/factories/ci/bridge.rb
+++ b/spec/factories/ci/bridge.rb
@@ -1,12 +1,14 @@
+# frozen_string_literal: true
+
FactoryBot.define do
factory :ci_bridge, class: Ci::Bridge do
- name ' bridge'
+ name 'bridge'
stage 'test'
stage_idx 0
ref 'master'
tag false
created_at 'Di 29. Okt 09:50:00 CET 2013'
- status :success
+ status :created
pipeline factory: :ci_pipeline
@@ -15,6 +17,7 @@ FactoryBot.define do
end
transient { downstream nil }
+ transient { upstream nil }
after(:build) do |bridge, evaluator|
bridge.project ||= bridge.pipeline.project
@@ -24,6 +27,12 @@ FactoryBot.define do
trigger: { project: evaluator.downstream.full_path }
)
end
+
+ if evaluator.upstream.present?
+ bridge.options = bridge.options.to_h.merge(
+ bridge_needs: { pipeline: evaluator.upstream.full_path }
+ )
+ end
end
end
end