1
0
Fork 0
forked from gitea/nas

Update rubocop-rspec to version 3.6.0 (#34497)

This commit is contained in:
Matt Jankowski 2025-04-24 10:56:13 -04:00 committed by GitHub
parent 22ec828951
commit 6463415e06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 223 additions and 228 deletions

View file

@ -12,7 +12,7 @@ RSpec.describe CacheBuster do
let(:purge_url) { 'https://example.com/test_purge' }
describe '#bust' do
shared_examples 'makes_request' do
shared_examples 'cache busting request' do
it 'makes an HTTP purging request' do
method = http_method&.to_sym || :get
stub_request(method, purge_url).to_return(status: 200)
@ -28,28 +28,28 @@ RSpec.describe CacheBuster do
end
context 'when using default options' do
include_examples 'makes_request'
it_behaves_like 'cache busting request'
end
context 'when specifying a secret header' do
let(:secret_header) { 'X-Purge-Secret' }
let(:secret) { SecureRandom.hex(20) }
include_examples 'makes_request'
it_behaves_like 'cache busting request'
end
context 'when specifying a PURGE method' do
let(:http_method) { 'purge' }
context 'when not using headers' do
include_examples 'makes_request'
it_behaves_like 'cache busting request'
end
context 'when specifying a secret header' do
let(:secret_header) { 'X-Purge-Secret' }
let(:secret) { SecureRandom.hex(20) }
include_examples 'makes_request'
it_behaves_like 'cache busting request'
end
end
end