diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-07-04 12:31:07 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-07-04 12:31:07 +0300 |
commit | 03f0f2566b3c536cf512b287e0d4d52d40a065c5 (patch) | |
tree | fd28c5029e51fa7240060a1a029903cc63ab3cc6 /spec/controllers | |
parent | d81ce8b25c50d96f47d6cdbcdfc3d1f66fca0f96 (diff) | |
parent | 04b046587fe609cd889f3fa518f08299abc61267 (diff) |
Merge branch 'bvl-graphql-pipeline-lists' into 'master'
Add pipeline lists to graphql
Closes #48469
See merge request gitlab-org/gitlab-ce!20249
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/pipelines_controller_spec.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb index 9618a8417ec..1cc7f33b57a 100644 --- a/spec/controllers/projects/pipelines_controller_spec.rb +++ b/spec/controllers/projects/pipelines_controller_spec.rb @@ -4,7 +4,7 @@ describe Projects::PipelinesController do include ApiHelpers set(:user) { create(:user) } - set(:project) { create(:project, :public, :repository) } + let(:project) { create(:project, :public, :repository) } let(:feature) { ProjectFeature::DISABLED } before do @@ -91,6 +91,24 @@ describe Projects::PipelinesController do end end + context 'when the project is private' do + let(:project) { create(:project, :private, :repository) } + + it 'returns `not_found` when the user does not have access' do + sign_in(create(:user)) + + get_pipelines_index_json + + expect(response).to have_gitlab_http_status(:not_found) + end + + it 'returns the pipelines when the user has access' do + get_pipelines_index_json + + expect(json_response['pipelines'].size).to eq(5) + end + end + def get_pipelines_index_json get :index, namespace_id: project.namespace, project_id: project, |