From 052029b09b132361fa18c7d4cf06a9702d7d0c84 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Fri, 17 Feb 2023 18:56:25 +0100 Subject: [PATCH] DEV: fix a flakey spec in slugs_controller (#20350) --- spec/integration/rate_limiting_spec.rb | 2 ++ spec/requests/slugs_controller_spec.rb | 1 + 2 files changed, 3 insertions(+) diff --git a/spec/integration/rate_limiting_spec.rb b/spec/integration/rate_limiting_spec.rb index cdda0a8a75b..24e903635ef 100644 --- a/spec/integration/rate_limiting_spec.rb +++ b/spec/integration/rate_limiting_spec.rb @@ -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 diff --git a/spec/requests/slugs_controller_spec.rb b/spec/requests/slugs_controller_spec.rb index 8eea9fa72fa..ddd21552624 100644 --- a/spec/requests/slugs_controller_spec.rb +++ b/spec/requests/slugs_controller_spec.rb @@ -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}"