Clear the cached settings before testing the rate limiter (#13669)

* Override the Settings::RateLimit.follow_count_daily

An interaction was occurring when the data update script test to move
these settings was run prior to the rate limit test - where the rate
limiter was created with the value 23 for the follow count, but the
settings module was reporting 500.

Stub out the database setting to an explicit value - and allow the
user follow count to be one more (so that we trigger the rate limit
and respond with a 429).

* Clear the settings cache before reading the values

This appears to correct the modification made (and reverted?) in the
data update test without requiring more changes to the context (which
remains as it was).
This commit is contained in:
Daniel Uber 2021-05-05 14:34:22 -05:00 committed by GitHub
parent 1754f43589
commit d145149de7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,6 +14,7 @@ RSpec.describe "Follows #create", type: :request do
before do
sign_in user
Settings::RateLimit.clear_cache
end
context "when rate limit has been hit" do