Methods
S
T
Instance Public methods
setup()
# File actionpack/test/controller/render_test.rb, line 604
def setup
  @request.host = "www.nextangle.com"
end
test_head_created()
# File actionpack/test/controller/render_test.rb, line 608
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 627
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 634
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 730
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 665
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_default_value_is_deprecated()
# File actionpack/test/controller/render_test.rb, line 620
def test_head_with_default_value_is_deprecated
  assert_deprecated do
    get :head_with_hash_does_not_include_status
    assert_response :ok
  end
end
test_head_with_integer_status()
# File actionpack/test/controller/render_test.rb, line 700
def test_head_with_integer_status
  Rack::Utils::HTTP_STATUS_CODES.each do |code, message|
    get :head_with_integer_status, params: { status: code.to_s }
    assert_equal message, @response.message
  end
end
test_head_with_location_header()
# File actionpack/test/controller/render_test.rb, line 641
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 648
def test_head_with_location_object
  with_routing do |set|
    set.draw do
      resources :customers

      ActiveSupport::Deprecation.silence do
        get ':controller/:action'
      end
    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 707
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 722
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 715
def test_head_with_string_status
  get :head_with_string_status, params: { 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 679
def test_head_with_symbolic_status
  get :head_with_symbolic_status, params: { status: "ok" }
  assert_equal 200, @response.status
  assert_response :ok

  get :head_with_symbolic_status, params: { status: "not_found" }
  assert_equal 404, @response.status
  assert_response :not_found

  get :head_with_symbolic_status, params: { 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, params: { 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 672
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
test_passing_hash_to_head_as_first_parameter_deprecated()
# File actionpack/test/controller/render_test.rb, line 614
def test_passing_hash_to_head_as_first_parameter_deprecated
  assert_deprecated do
    get :head_with_status_hash
  end
end