Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-01-22 17:05:44 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-01-25 12:38:01 +0300
commit67464972c0dc0df57026f70e8ce3655dc5c205ba (patch)
tree2eefe8d6c3232699550008f92d87e82c5debe185 /spec/factories/ci
parent531626ee160a70bbc8063162d1ecd22e49c91dfb (diff)
Make it possible to pass downstream to bridge factory
Diffstat (limited to 'spec/factories/ci')
-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