diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-13 09:08:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-13 09:08:02 +0300 |
commit | 2c1525618498a2aab2eed6a36f5045ce3f93ac6f (patch) | |
tree | a34cf3963e76388348cb4533d6fa8de4e1ce73c4 /spec/controllers | |
parent | 2fc7740f3ca1ca5e5a88f9f4136d631f7650bac7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/pipelines_controller_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb index 3c34d41504d..67ec14cb616 100644 --- a/spec/controllers/projects/pipelines_controller_spec.rb +++ b/spec/controllers/projects/pipelines_controller_spec.rb @@ -195,6 +195,26 @@ describe Projects::PipelinesController do end end + context 'filter by ref' do + let!(:pipeline) { create(:ci_pipeline, :running, project: project, ref: 'branch-1') } + + context 'when pipelines with the ref exists' do + it 'returns matched pipelines' do + get_pipelines_index_json(ref: 'branch-1') + + check_pipeline_response(returned: 1, all: 1, running: 1, pending: 0, finished: 0) + end + end + + context 'when no pipeline with the ref exists' do + it 'returns empty list' do + get_pipelines_index_json(ref: 'invalid-ref') + + check_pipeline_response(returned: 0, all: 0, running: 0, pending: 0, finished: 0) + end + end + end + def get_pipelines_index_json(params = {}) get :index, params: { namespace_id: project.namespace, |