Then /^the response should be valid for (.+) minutes$/ do |n| page.response_headers['Cache-Control'].split(/,\s*/).should include("max-age=#{n.to_i * 60}") end Then /^the cache should be public/ do page.response_headers['Cache-Control'].split(/,\s*/).should include("public") end Then /^there must be no cache at all$/ do parts = page.response_headers['Cache-Control'].split(/,\s*/) parts.should include('must-revalidate') parts.should include('max-age=0') end Then 'there must be no cookies' do cookies.should == {} end Then /^there must be a cookie "(.+)"$/ do |cookie_name| cookies.keys.should include(cookie_name) end