Sha256: 4bc60249cfa2b0f5a84b45df144e6a95d55b4bdf1f9da0628e3fe820be017b71
Contents?: true
Size: 1.12 KB
Versions: 8
Compression:
Stored size: 1.12 KB
Contents
Before do Radiant::Cache.use_x_sendfile = false Radiant::Cache.use_x_accel_redirect = nil end Given /^the page cache is clear$/ do # No-op until we have Rack::Cache installed Radiant::Cache.clear if defined?(Radiant::Cache) end Then /^I should get a (\d+) response code$/ do |code| response.response_code.should == code.to_i end Given /^I have turned on X\-Sendfile headers$/ do Radiant::Cache.use_x_sendfile = true end Then /^I should( not)? get an "([^\"]*)" header in the response$/ do |status, header_key| if status.nil? response.headers.to_hash[header_key].should_not be_empty else response.headers.to_hash[header_key].should be_empty end end Given /^I have turned on X\-Accel\-Redirect headers$/ do Radiant::Cache.use_x_accel_redirect = "/cache" end Given /^I have page caching (on|off)$/ do |status| set_page_cache status end Then /^The "([^\"]*)" header should be "([^\"]*)"$/ do |header_key, value| response.headers.to_hash[header_key].should =~ Regexp.new(value) end def set_page_cache(status) Page.class_eval %{ def cache? #{status != 'off'} end }, __FILE__, __LINE__ end
Version data entries
8 entries across 8 versions & 3 rubygems