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:
Diffstat (limited to 'spec/requests/api/search_spec.rb')
-rw-r--r--spec/requests/api/search_spec.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/requests/api/search_spec.rb b/spec/requests/api/search_spec.rb
index 1b331e9c099..0feff90d088 100644
--- a/spec/requests/api/search_spec.rb
+++ b/spec/requests/api/search_spec.rb
@@ -688,6 +688,16 @@ RSpec.describe API::Search, :clean_gitlab_redis_rate_limiting, feature_category:
end
end
+ context 'when user does not have permissions for scope' do
+ it 'returns an empty array' do
+ project.project_feature.update!(issues_access_level: Gitlab::VisibilityLevel::PRIVATE)
+
+ get api(endpoint, user), params: { scope: 'issues', search: 'awesome' }
+
+ expect(json_response).to be_empty
+ end
+ end
+
context 'when project does not exist' do
it 'returns 404 error' do
get api('/projects/0/search', user), params: { scope: 'issues', search: 'awesome' }
@@ -861,7 +871,7 @@ RSpec.describe API::Search, :clean_gitlab_redis_rate_limiting, feature_category:
get api(endpoint, user), params: { scope: 'wiki_blobs', search: 'awesome' }
end
- it_behaves_like 'response is correct', schema: 'public_api/v4/blobs'
+ it_behaves_like 'response is correct', schema: 'public_api/v4/wiki_blobs'
it_behaves_like 'ping counters', scope: :wiki_blobs