Sha256: cd8e67dfc0e73c6ac3ca9017f550677f05a12731359f85582620ebb03ac7732f

Contents?: true

Size: 700 Bytes

Versions: 31

Compression:

Stored size: 700 Bytes

Contents

require "#{File.dirname(__FILE__)}/spec_setup"
require 'rack/cache/request'

describe 'Rack::Cache::Request' do
  it 'is marked as no_cache when the Cache-Control header includes the no-cache directive' do
    request = Rack::Cache::Request.new('HTTP_CACHE_CONTROL' => 'public, no-cache')
    assert request.no_cache?
  end

  it 'is marked as no_cache when request should not be loaded from cache' do
    request = Rack::Cache::Request.new('HTTP_PRAGMA' => 'no-cache')
    assert request.no_cache?
  end

  it 'is not marked as no_cache when neither no-cache directive is specified' do
    request = Rack::Cache::Request.new('HTTP_CACHE_CONTROL' => 'public')
    assert !request.no_cache?
  end
end

Version data entries

31 entries across 31 versions & 6 rubygems

Version Path
josh-rack-cache-0.5.1 test/request_test.rb
rtomayko-rack-cache-0.3.9 test/request_test.rb
rtomayko-rack-cache-0.4 test/request_test.rb
rtomayko-rack-cache-0.5.1 test/request_test.rb
rtomayko-rack-cache-0.5 test/request_test.rb
radiant-1.0.0.rc2 vendor/rack-cache/test/request_test.rb
radiant-1.0.0.rc1 vendor/rack-cache/test/request_test.rb
rack-cache-1.0 test/request_test.rb
radiantcms-couchrest_model-0.2.4 vendor/rack-cache/test/request_test.rb
radiantcms-couchrest_model-0.2.2 vendor/rack-cache/test/request_test.rb
radiantcms-couchrest_model-0.2.1 vendor/rack-cache/test/request_test.rb
radiantcms-couchrest_model-0.2 vendor/rack-cache/test/request_test.rb
radiantcms-couchrest_model-0.1.9 vendor/rack-cache/test/request_test.rb
radiantcms-couchrest_model-0.1.8 vendor/rack-cache/test/request_test.rb
radiantcms-couchrest_model-0.1.7 vendor/rack-cache/test/request_test.rb
radiantcms-couchrest_model-0.1.6 vendor/rack-cache/test/request_test.rb
radiantcms-couchrest_model-0.1.5 vendor/rack-cache/test/request_test.rb
radiantcms-couchrest_model-0.1.3 vendor/rack-cache/test/request_test.rb
radiantcms-couchrest_model-0.1.2 vendor/rack-cache/test/request_test.rb
radiantcms-couchrest_model-0.1.1 vendor/rack-cache/test/request_test.rb