DEV: fix a flakey spec in slugs_controller (#20350)

This commit is contained in:
Joffrey JAFFEUX 2023-02-17 18:56:25 +01:00 committed by GitHub
parent a945ca3e01
commit 052029b09b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -44,6 +44,8 @@ RSpec.describe "rate limiter integration" do
expect(response.cookies.has_key?(name)).to eq(true)
expect(response.cookies[name]).to be_nil
end
RateLimiter.clear_all!
end
it "can cleanly limit requests and sets a Retry-After header" do

View File

@ -24,6 +24,7 @@ RSpec.describe SlugsController do
it "rate limits" do
RateLimiter.enable
RateLimiter.clear_all!
stub_const(SlugsController, "MAX_SLUG_GENERATIONS_PER_MINUTE", 1) do
post "/slugs.json?name=#{name}"