debian-mirror-gitlab/spec/factories/ci/bridge.rb

30 lines
671 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
FactoryBot.define do
factory :ci_bridge, class: Ci::Bridge do
name ' bridge'
stage 'test'
stage_idx 0
ref 'master'
tag false
created_at 'Di 29. Okt 09:50:00 CET 2013'
status :success
pipeline factory: :ci_pipeline
2019-03-02 22:35:43 +05:30
trait :variables do
yaml_variables [{ key: 'BRIDGE', value: 'cross', public: true }]
end
transient { downstream nil }
2019-02-15 15:39:39 +05:30
after(:build) do |bridge, evaluator|
bridge.project ||= bridge.pipeline.project
2019-03-02 22:35:43 +05:30
if evaluator.downstream.present?
bridge.options = bridge.options.to_h.merge(
trigger: { project: evaluator.downstream.full_path }
)
end
2019-02-15 15:39:39 +05:30
end
end
end