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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-11-23 00:10:35 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-23 00:10:35 +0300
commitebaefcebccee0575e8dddde1fe17dabaae62459b (patch)
tree286bf98e899eb48a0b2a4bbd6f0c506f6409b5a2 /spec/requests
parent39cc8695fc20e17f4989fa99aa9fafc00f9e2953 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/projects_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index 4f84e6f2562..332dc938833 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -1504,6 +1504,20 @@ RSpec.describe API::Projects do
expect(json_response.map { |project| project['id'] }).to contain_exactly(private_project1.id)
end
+ context 'and using an admin to search', :enable_admin_mode, :aggregate_errors do
+ it 'returns users projects when authenticated as admin' do
+ private_project1 = create(:project, :private, name: 'private_project1', creator_id: user4.id, namespace: user4.namespace)
+
+ # min_access_level does not make any difference when admins search for a user's projects
+ get api("/users/#{user4.id}/projects/", admin), params: { min_access_level: 30 }
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(response).to include_pagination_headers
+ expect(json_response).to be_an Array
+ expect(json_response.map { |project| project['id'] }).to contain_exactly(project4.id, private_project1.id, public_project.id)
+ end
+ end
+
context 'and using the programming language filter' do
include_context 'with language detection'