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:
Diffstat (limited to 'spec/models/ci/bridge_spec.rb')
-rw-r--r--spec/models/ci/bridge_spec.rb20
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) }