class HttpCacheForeverTest

Public Instance Methods

test_cache_response_code_with_etag() click to toggle source
# File actionpack/test/controller/render_test.rb, line 802
def test_cache_response_code_with_etag
  get :cache_me_forever
  assert_response :ok

  @request.if_none_match = @response.etag
  get :cache_me_forever
  assert_response :not_modified
end
test_cache_response_code_with_if_modified_since() click to toggle source
# File actionpack/test/controller/render_test.rb, line 793
def test_cache_response_code_with_if_modified_since
  get :cache_me_forever
  assert_response :ok

  @request.if_modified_since = @response.headers["Last-Modified"]
  get :cache_me_forever
  assert_response :not_modified
end
test_cache_with_private() click to toggle source
# File actionpack/test/controller/render_test.rb, line 785
def test_cache_with_private
  get :cache_me_forever
  assert_response :ok
  assert_equal "max-age=#{100.years}, private", @response.headers["Cache-Control"]
  assert_not_nil @response.etag
  assert @response.weak_etag?
end
test_cache_with_public() click to toggle source
# File actionpack/test/controller/render_test.rb, line 777
def test_cache_with_public
  get :cache_me_forever, params: { public: true }
  assert_response :ok
  assert_equal "max-age=#{100.years}, public", @response.headers["Cache-Control"]
  assert_not_nil @response.etag
  assert @response.weak_etag?
end