Extract shared example for cacheable response in specs (#25388)
This commit is contained in:
parent
708299bb0d
commit
893b2f33fd
6 changed files with 27 additions and 91 deletions
|
@ -7,22 +7,6 @@ RSpec.describe ActivityPub::CollectionsController do
|
|||
let!(:private_pinned) { Fabricate(:status, account: account, text: 'secret private stuff', visibility: :private) }
|
||||
let(:remote_account) { nil }
|
||||
|
||||
shared_examples 'cacheable response' do
|
||||
it 'does not set cookies' do
|
||||
expect(response.cookies).to be_empty
|
||||
expect(response.headers['Set-Cookies']).to be_nil
|
||||
end
|
||||
|
||||
it 'does not set sessions' do
|
||||
response
|
||||
expect(session).to be_empty
|
||||
end
|
||||
|
||||
it 'returns public Cache-Control header' do
|
||||
expect(response.headers['Cache-Control']).to include 'public'
|
||||
end
|
||||
end
|
||||
|
||||
before do
|
||||
allow(controller).to receive(:signed_request_actor).and_return(remote_account)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue