private_cache_control.rb 375 B

1234567891011121314
  1. # frozen_string_literal: true
  2. RSpec::Matchers.define :have_private_cache_control do
  3. match do |page|
  4. page.response_headers['Cache-Control'] == 'private, no-store'
  5. end
  6. failure_message do |page|
  7. <<~ERROR
  8. Expected page to have `Cache-Control` header with `private, no-store` but it has:
  9. #{page.response_headers['Cache-Control']}
  10. ERROR
  11. end
  12. end