mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
DEV: Use proper wording for contexts in specs
This commit is contained in:

committed by
Loïc Guitaut

parent
02987e05d5
commit
3eaac56797
@ -12,7 +12,7 @@ RSpec.describe Middleware::AnonymousCache do
|
||||
Middleware::AnonymousCache::Helper.new(env(opts))
|
||||
end
|
||||
|
||||
context "cacheable?" do
|
||||
describe "#cacheable?" do
|
||||
it "true by default" do
|
||||
expect(new_helper.cacheable?).to eq(true)
|
||||
end
|
||||
@ -38,7 +38,7 @@ RSpec.describe Middleware::AnonymousCache do
|
||||
end
|
||||
end
|
||||
|
||||
context "per theme cache" do
|
||||
describe "per theme cache" do
|
||||
it "handles theme keys" do
|
||||
theme = Fabricate(:theme, user_selectable: true)
|
||||
|
||||
@ -93,7 +93,7 @@ RSpec.describe Middleware::AnonymousCache do
|
||||
expect(key1).not_to eq(key2)
|
||||
end
|
||||
|
||||
context "cached" do
|
||||
context "when cached" do
|
||||
let!(:helper) do
|
||||
new_helper("ANON_CACHE_DURATION" => 10)
|
||||
end
|
||||
@ -151,7 +151,7 @@ RSpec.describe Middleware::AnonymousCache do
|
||||
end
|
||||
end
|
||||
|
||||
context 'background request rate limit' do
|
||||
describe 'background request rate limit' do
|
||||
it 'will rate limit background requests' do
|
||||
|
||||
app = Middleware::AnonymousCache.new(
|
||||
@ -194,7 +194,7 @@ RSpec.describe Middleware::AnonymousCache do
|
||||
end
|
||||
end
|
||||
|
||||
context 'force_anonymous!' do
|
||||
describe '#force_anonymous!' do
|
||||
before do
|
||||
RateLimiter.enable
|
||||
end
|
||||
@ -260,7 +260,7 @@ RSpec.describe Middleware::AnonymousCache do
|
||||
end
|
||||
end
|
||||
|
||||
context 'invalid request payload' do
|
||||
describe 'invalid request payload' do
|
||||
it 'returns 413 for GET request with payload' do
|
||||
status, headers, _ = middleware.call(env.tap do |environment|
|
||||
environment[Rack::RACK_INPUT].write("test")
|
||||
@ -271,7 +271,7 @@ RSpec.describe Middleware::AnonymousCache do
|
||||
end
|
||||
end
|
||||
|
||||
context "crawler blocking" do
|
||||
describe "crawler blocking" do
|
||||
let :non_crawler do
|
||||
{
|
||||
"HTTP_USER_AGENT" =>
|
||||
|
Reference in New Issue
Block a user