diff options
Diffstat (limited to 'spec/finders/ci/pipelines_finder_spec.rb')
-rw-r--r-- | spec/finders/ci/pipelines_finder_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/finders/ci/pipelines_finder_spec.rb b/spec/finders/ci/pipelines_finder_spec.rb index 16561aa65b6..c7bd52576e8 100644 --- a/spec/finders/ci/pipelines_finder_spec.rb +++ b/spec/finders/ci/pipelines_finder_spec.rb @@ -252,6 +252,29 @@ RSpec.describe Ci::PipelinesFinder do end end + context 'when source is specified' do + let(:params) { { source: 'web' } } + let!(:web_pipeline) { create(:ci_pipeline, project: project, source: 'web') } + let!(:push_pipeline) { create(:ci_pipeline, project: project, source: 'push') } + let!(:api_pipeline) { create(:ci_pipeline, project: project, source: 'api') } + + context 'when `pipeline_source_filter` feature flag is disabled' do + before do + stub_feature_flags(pipeline_source_filter: false) + end + + it 'returns all the pipelines' do + is_expected.to contain_exactly(web_pipeline, push_pipeline, api_pipeline) + end + end + + context 'when `pipeline_source_filter` feature flag is enabled' do + it 'returns only the matched pipeline' do + is_expected.to eq([web_pipeline]) + end + end + end + describe 'ordering' do using RSpec::Parameterized::TableSyntax |