DEV: fix a flakey spec in slugs_controller (#20350)
This commit is contained in:
parent
a945ca3e01
commit
052029b09b
|
@ -44,6 +44,8 @@ RSpec.describe "rate limiter integration" do
|
||||||
expect(response.cookies.has_key?(name)).to eq(true)
|
expect(response.cookies.has_key?(name)).to eq(true)
|
||||||
expect(response.cookies[name]).to be_nil
|
expect(response.cookies[name]).to be_nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
RateLimiter.clear_all!
|
||||||
end
|
end
|
||||||
|
|
||||||
it "can cleanly limit requests and sets a Retry-After header" do
|
it "can cleanly limit requests and sets a Retry-After header" do
|
||||||
|
|
|
@ -24,6 +24,7 @@ RSpec.describe SlugsController do
|
||||||
|
|
||||||
it "rate limits" do
|
it "rate limits" do
|
||||||
RateLimiter.enable
|
RateLimiter.enable
|
||||||
|
RateLimiter.clear_all!
|
||||||
|
|
||||||
stub_const(SlugsController, "MAX_SLUG_GENERATIONS_PER_MINUTE", 1) do
|
stub_const(SlugsController, "MAX_SLUG_GENERATIONS_PER_MINUTE", 1) do
|
||||||
post "/slugs.json?name=#{name}"
|
post "/slugs.json?name=#{name}"
|
||||||
|
|
Loading…
Reference in New Issue