summaryrefslogtreecommitdiff
path: root/spec/factories
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-01-22 15:05:44 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-01-25 10:38:01 +0100
commit67464972c0dc0df57026f70e8ce3655dc5c205ba (patch)
tree2eefe8d6c3232699550008f92d87e82c5debe185 /spec/factories
parent531626ee160a70bbc8063162d1ecd22e49c91dfb (diff)
downloadgitlab-ce-67464972c0dc0df57026f70e8ce3655dc5c205ba.tar.gz
Make it possible to pass downstream to bridge factory
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/ci/bridge.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/factories/ci/bridge.rb b/spec/factories/ci/bridge.rb
index 5f83b80ad7b..39427f416a0 100644
--- a/spec/factories/ci/bridge.rb
+++ b/spec/factories/ci/bridge.rb
@@ -10,8 +10,16 @@ FactoryBot.define do
pipeline factory: :ci_pipeline
+ transient { downstream nil }
+
after(:build) do |bridge, evaluator|
bridge.project ||= bridge.pipeline.project
+
+ if evaluator.downstream.present?
+ bridge.options = bridge.options.to_h.merge(
+ trigger: { project: evaluator.downstream.full_path }
+ )
+ end
end
end
end