Use clean_gitlab_redis_rate_limiting in search specs to avoid rate limiting
Summary
After implementing search limit in our backend we have a need to supress this limit in some rspec tests
Improvements
So far we've been using:
allow(Gitlab::ApplicationRateLimiter).to receive(:threshold).with(:search_rate_limit).and_return(1000)
allow(Gitlab::ApplicationRateLimiter).to receive(:threshold).with(:search_rate_limit_unauthenticated).and_return(1000)
@john-mason noted in his review that it would be nice to put this functionality inside a helper.
Involved components
so far this two-line stub was used in following tests:
spec/requests/api/search_spec.rb
Proposal
The spec trait :disable_rate_limiter will disable rate limiting in before each spec run and should be used in place of the allow/receive code above.
Edited by Terri Chu