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/support/shared_examples/requests/api/issuable_search_shared_examples.rb')
-rw-r--r--spec/support/shared_examples/requests/api/issuable_search_shared_examples.rb51
1 files changed, 0 insertions, 51 deletions
diff --git a/spec/support/shared_examples/requests/api/issuable_search_shared_examples.rb b/spec/support/shared_examples/requests/api/issuable_search_shared_examples.rb
index fcde3b65b4f..f06a80375e8 100644
--- a/spec/support/shared_examples/requests/api/issuable_search_shared_examples.rb
+++ b/spec/support/shared_examples/requests/api/issuable_search_shared_examples.rb
@@ -1,40 +1,5 @@
# frozen_string_literal: true
-RSpec.shared_examples 'issuable anonymous search' do
- context 'with anonymous user' do
- context 'with disable_anonymous_search disabled' do
- before do
- stub_feature_flags(disable_anonymous_search: false)
- end
-
- it 'returns issuables matching given search string for title' do
- get api(url), params: { scope: 'all', search: issuable.title }
-
- expect_paginated_array_response(result)
- end
-
- it 'returns issuables matching given search string for description' do
- get api(url), params: { scope: 'all', search: issuable.description }
-
- expect_paginated_array_response(result)
- end
- end
-
- context 'with disable_anonymous_search enabled' do
- before do
- stub_feature_flags(disable_anonymous_search: true)
- end
-
- it "returns 422 error" do
- get api(url), params: { scope: 'all', search: issuable.title }
-
- expect(response).to have_gitlab_http_status(:unprocessable_entity)
- expect(json_response['message']).to eq('User must be authenticated to use search')
- end
- end
- end
-end
-
RSpec.shared_examples 'issuable API rate-limited search' do
it_behaves_like 'rate limited endpoint', rate_limit_key: :search_rate_limit do
let(:current_user) { user }
@@ -49,20 +14,4 @@ RSpec.shared_examples 'issuable API rate-limited search' do
get api(url), params: { scope: 'all', search: issuable.title }
end
end
-
- context 'when rate_limit_issuable_searches is disabled', :freeze_time, :clean_gitlab_redis_rate_limiting do
- before do
- stub_feature_flags(rate_limit_issuable_searches: false)
-
- allow(Gitlab::ApplicationRateLimiter).to receive(:threshold)
- .with(:search_rate_limit_unauthenticated).and_return(1)
- end
-
- it 'does not enforce the rate limit' do
- get api(url), params: { scope: 'all', search: issuable.title }
- get api(url), params: { scope: 'all', search: issuable.title }
-
- expect(response).to have_gitlab_http_status(:ok)
- end
- end
end