Methods
S
T
Instance Public methods
setup()
# File actionpack/test/controller/render_test.rb, line 556
def setup
  @request.host = "www.nextangle.com"
end
test_head_created()
# File actionpack/test/controller/render_test.rb, line 560
def test_head_created
  post :head_created
  assert @response.body.blank?
  assert_response :created
end
test_head_created_with_application_json_content_type()
# File actionpack/test/controller/render_test.rb, line 566
def test_head_created_with_application_json_content_type
  post :head_created_with_application_json_content_type
  assert @response.body.blank?
  assert_equal "application/json", @response.header["Content-Type"]
  assert_response :created
end
test_head_ok_with_image_png_content_type()
# File actionpack/test/controller/render_test.rb, line 573
def test_head_ok_with_image_png_content_type
  post :head_ok_with_image_png_content_type
  assert @response.body.blank?
  assert_equal "image/png", @response.header["Content-Type"]
  assert_response :ok
end
test_head_returns_truthy_value()
# File actionpack/test/controller/render_test.rb, line 666
def test_head_returns_truthy_value
  assert_nothing_raised do
    get :head_and_return
  end
end
test_head_with_custom_header()
# File actionpack/test/controller/render_test.rb, line 601
def test_head_with_custom_header
  get :head_with_custom_header
  assert @response.body.blank?
  assert_equal "something", @response.headers["X-Custom-Header"]
  assert_response :ok
end
test_head_with_integer_status()
# File actionpack/test/controller/render_test.rb, line 636
def test_head_with_integer_status
  Rack::Utils::HTTP_STATUS_CODES.each do |code, message|
    get :head_with_integer_status, :status => code.to_s
    assert_equal message, @response.message
  end
end
test_head_with_location_header()
# File actionpack/test/controller/render_test.rb, line 580
def test_head_with_location_header
  get :head_with_location_header
  assert @response.body.blank?
  assert_equal "/foo", @response.headers["Location"]
  assert_response :ok
end
test_head_with_location_object()
# File actionpack/test/controller/render_test.rb, line 587
def test_head_with_location_object
  with_routing do |set|
    set.draw do
      resources :customers
      get ':controller/:action'
    end

    get :head_with_location_object
    assert @response.body.blank?
    assert_equal "http://www.nextangle.com/customers/1", @response.headers["Location"]
    assert_response :ok
  end
end
test_head_with_no_content()
# File actionpack/test/controller/render_test.rb, line 643
def test_head_with_no_content
  get :head_with_no_content

  assert_equal 204, @response.status
  assert_nil @response.headers["Content-Type"]
  assert_nil @response.headers["Content-Length"]
end
test_head_with_status_code_first()
# File actionpack/test/controller/render_test.rb, line 658
def test_head_with_status_code_first
  get :head_with_status_code_first
  assert_equal 403, @response.response_code
  assert_equal "Forbidden", @response.message
  assert_equal "something", @response.headers["X-Custom-Header"]
  assert_response :forbidden
end
test_head_with_string_status()
# File actionpack/test/controller/render_test.rb, line 651
def test_head_with_string_status
  get :head_with_string_status, :status => "404 Eat Dirt"
  assert_equal 404, @response.response_code
  assert_equal "Not Found", @response.message
  assert_response :not_found
end
test_head_with_symbolic_status()
# File actionpack/test/controller/render_test.rb, line 615
def test_head_with_symbolic_status
  get :head_with_symbolic_status, :status => "ok"
  assert_equal 200, @response.status
  assert_response :ok

  get :head_with_symbolic_status, :status => "not_found"
  assert_equal 404, @response.status
  assert_response :not_found

  get :head_with_symbolic_status, :status => "no_content"
  assert_equal 204, @response.status
  assert !@response.headers.include?('Content-Length')
  assert_response :no_content

  Rack::Utils::SYMBOL_TO_STATUS_CODE.each do |status, code|
    get :head_with_symbolic_status, :status => status.to_s
    assert_equal code, @response.response_code
    assert_response status
  end
end
test_head_with_www_authenticate_header()
# File actionpack/test/controller/render_test.rb, line 608
def test_head_with_www_authenticate_header
  get :head_with_www_authenticate_header
  assert @response.body.blank?
  assert_equal "something", @response.headers["WWW-Authenticate"]
  assert_response :ok
end