diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /spec/models/ci/bridge_spec.rb | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'spec/models/ci/bridge_spec.rb')
-rw-r--r-- | spec/models/ci/bridge_spec.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/spec/models/ci/bridge_spec.rb b/spec/models/ci/bridge_spec.rb index df24c92149d..169b00b9c74 100644 --- a/spec/models/ci/bridge_spec.rb +++ b/spec/models/ci/bridge_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Ci::Bridge do +RSpec.describe Ci::Bridge, feature_category: :continuous_integration do let_it_be(:project) { create(:project) } let_it_be(:target_project) { create(:project, name: 'project', namespace: create(:namespace, name: 'my')) } let_it_be(:pipeline) { create(:ci_pipeline, project: project) } @@ -34,6 +34,24 @@ RSpec.describe Ci::Bridge do expect(bridge).to have_one(:downstream_pipeline) end + describe '#sourced_pipelines' do + subject { bridge.sourced_pipelines } + + it 'raises error' do + expect { subject }.to raise_error RuntimeError, 'Ci::Bridge does not have sourced_pipelines association' + end + + context 'when ci_bridge_remove_sourced_pipelines is disabled' do + before do + stub_feature_flags(ci_bridge_remove_sourced_pipelines: false) + end + + it 'returns the sourced_pipelines association' do + expect(bridge.sourced_pipelines).to eq([]) + end + end + end + describe '#retryable?' do let(:bridge) { create(:ci_bridge, :success) } |