Methods
E
T
Instance Public methods
etag(record)
# File actionpack/test/controller/render_test.rb, line 528
def etag(record)
  Digest::MD5.hexdigest(ActiveSupport::Cache.expand_cache_key(record)).inspect
end
test_array()
# File actionpack/test/controller/render_test.rb, line 492
def test_array
  @request.if_none_match = etag([%w(1 2 3), 'ab', :cde, [:f]])
  get :array
  assert_response :not_modified

  @request.if_none_match = %Q("nomatch")
  get :array
  assert_response :success
end
test_etag_reflects_template_digest()
# File actionpack/test/controller/render_test.rb, line 502
def test_etag_reflects_template_digest
  get :with_template
  assert_response :ok
  assert_not_nil etag = @response.etag

  request.if_none_match = etag
  get :with_template
  assert_response :not_modified

  # Modify the template digest
  path = File.expand_path('../../fixtures/test/hello_world.erb', __FILE__)
  old = File.read(path)

  begin
    File.write path, 'foo'
    ActionView::Digestor.cache.clear

    request.if_none_match = etag
    get :with_template
    assert_response :ok
    assert_not_equal etag, @response.etag
  ensure
    File.write path, old
  end
end
test_multiple_etags()
# File actionpack/test/controller/render_test.rb, line 482
def test_multiple_etags
  @request.if_none_match = etag(["123", 'ab', :cde, [:f]])
  get :fresh
  assert_response :not_modified

  @request.if_none_match = %Q("nomatch")
  get :fresh
  assert_response :success
end