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
path: root/spec
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-04-29 21:11:25 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2018-04-29 21:11:25 +0300
commit87f1736a7381f39e373ce5bdae2d7185b9523108 (patch)
treec4a2cfbf20e59da8299cc3bef87f99e81a71dff1 /spec
parentee189fd511e1a2c06f05e0d40e1d0b8875151391 (diff)
parentb65fcc320d65367973a58a01618914056993541b (diff)
Merge branch 'jramsay-44880-filter-pipelines-by-sha' into 'master'
Add sha filter to list pipelines Closes #44880 See merge request gitlab-org/gitlab-ce!18125
Diffstat (limited to 'spec')
-rw-r--r--spec/finders/pipelines_finder_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/finders/pipelines_finder_spec.rb b/spec/finders/pipelines_finder_spec.rb
index 2b19cda35b0..d6253b605b9 100644
--- a/spec/finders/pipelines_finder_spec.rb
+++ b/spec/finders/pipelines_finder_spec.rb
@@ -203,5 +203,25 @@ describe PipelinesFinder do
end
end
end
+
+ context 'when sha is specified' do
+ let!(:pipeline) { create(:ci_pipeline, project: project, sha: '97de212e80737a608d939f648d959671fb0a0142') }
+
+ context 'when sha exists' do
+ let(:params) { { sha: '97de212e80737a608d939f648d959671fb0a0142' } }
+
+ it 'returns matched pipelines' do
+ is_expected.to eq([pipeline])
+ end
+ end
+
+ context 'when sha does not exist' do
+ let(:params) { { sha: 'invalid-sha' } }
+
+ it 'returns empty' do
+ is_expected.to be_empty
+ end
+ end
+ end
end
end