class TestFormatConstraints

Constants

APP
Routes

Public Instance Methods

app() click to toggle source
# File actionpack/test/dispatch/routing_test.rb, line 4558
def app; APP end
test_enforce_with_format_true_with_constraint() click to toggle source
# File actionpack/test/dispatch/routing_test.rb, line 4582
def test_enforce_with_format_true_with_constraint
  get "http://www.example.com/json_only.json"
  assert_response :success

  get "http://www.example.com/json_only.html"
  assert_response :not_found

  get "http://www.example.com/json_only"
  assert_response :not_found
end
test_enforce_with_string() click to toggle source
# File actionpack/test/dispatch/routing_test.rb, line 4593
def test_enforce_with_string
  get "http://www.example.com/xml_only.xml"
  assert_response :success

  get "http://www.example.com/xml_only"
  assert_response :success

  get "http://www.example.com/xml_only.json"
  assert_response :not_found
end
test_regexp_format_constraints() click to toggle source
# File actionpack/test/dispatch/routing_test.rb, line 4571
def test_regexp_format_constraints
  get "http://www.example.com/regexp"
  assert_response :success

  get "http://www.example.com/regexp.json"
  assert_response :success

  get "http://www.example.com/regexp.html"
  assert_response :not_found
end
test_string_format_constraints() click to toggle source
# File actionpack/test/dispatch/routing_test.rb, line 4560
def test_string_format_constraints
  get "http://www.example.com/string"
  assert_response :success

  get "http://www.example.com/string.json"
  assert_response :success

  get "http://www.example.com/string.html"
  assert_response :not_found
end