Extract shared example for cacheable response in specs (#25388)

This commit is contained in:
Matt Jankowski 2023-10-16 11:52:06 -04:00 committed by GitHub
parent 708299bb0d
commit 893b2f33fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 27 additions and 91 deletions

View file

@ -8,22 +8,6 @@ RSpec.describe ActivityPub::RepliesController do
let(:remote_reply_id) { 'https://foobar.com/statuses/1234' }
let(:remote_querier) { 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
shared_examples 'common behavior' do
context 'when status is private' do
let(:parent_visibility) { :private }