1
0
mirror of https://github.com/funamitech/mastodon synced 2024-12-24 11:38:37 +09:00
YuruToot/spec/support/examples/cache.rb

15 lines
481 B
Ruby
Raw Normal View History

# frozen_string_literal: true
shared_examples 'cacheable response' do |expects_vary: false|
it 'sets correct cache and vary headers and does not set cookies or session', :aggregate_failures do
expect(response.cookies).to be_empty
expect(response.headers['Set-Cookies']).to be_nil
expect(session).to be_empty
expect(response.headers['Vary']).to include(expects_vary) if expects_vary
expect(response.headers['Cache-Control']).to include('public')
end
end