summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-30 15:16:56 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-30 15:16:56 +0000
commitfa2fec1d18330e4cd9803ff164db19e7367e3838 (patch)
tree91a9bf1c74eeff29690f33e3faf2b8ca87051af3 /spec/requests
parent8ee0746f54c19fcb8fe81058594aa8d373c5b7d7 (diff)
downloadgitlab-ce-fa2fec1d18330e4cd9803ff164db19e7367e3838.tar.gz
Add latest changes from gitlab-org/security/gitlab@13-5-stable-ee
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/internal/kubernetes_spec.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/requests/api/internal/kubernetes_spec.rb b/spec/requests/api/internal/kubernetes_spec.rb
index f669483b5a4..a532b8e59f2 100644
--- a/spec/requests/api/internal/kubernetes_spec.rb
+++ b/spec/requests/api/internal/kubernetes_spec.rb
@@ -166,6 +166,16 @@ RSpec.describe API::Internal::Kubernetes do
)
)
end
+
+ context 'repository is for project members only' do
+ let(:project) { create(:project, :public, :repository_private) }
+
+ it 'returns 404' do
+ send_request(params: { id: project.id }, headers: { 'Authorization' => "Bearer #{agent_token.token}" })
+
+ expect(response).to have_gitlab_http_status(:not_found)
+ end
+ end
end
context 'project is private' do
@@ -190,7 +200,7 @@ RSpec.describe API::Internal::Kubernetes do
context 'project does not exist' do
it 'returns 404' do
- send_request(params: { id: 0 }, headers: { 'Authorization' => "Bearer #{agent_token.token}" })
+ send_request(params: { id: non_existing_record_id }, headers: { 'Authorization' => "Bearer #{agent_token.token}" })
expect(response).to have_gitlab_http_status(:not_found)
end