class TestRoutingMount

Constants

APP
Router
SprocketsApp

Public Instance Methods

app() click to toggle source
# File actionpack/test/dispatch/mount_test.rb, line 47
def app
  APP
end
test_app_name_is_properly_generated_when_engine_is_mounted_in_resources() click to toggle source
# File actionpack/test/dispatch/mount_test.rb, line 51
def test_app_name_is_properly_generated_when_engine_is_mounted_in_resources
  assert Router.mounted_helpers.method_defined?(:user_fake_mounted_at_resource),
        "A mounted helper should be defined with a parent's prefix"
  assert Router.named_routes.key?(:user_fake_mounted_at_resource),
        "A named route should be defined with a parent's prefix"
end
test_mounting_at_root_path() click to toggle source
# File actionpack/test/dispatch/mount_test.rb, line 58
def test_mounting_at_root_path
  get "/omg"
  assert_equal " -- /omg", response.body
end
test_mounting_sets_script_name() click to toggle source
# File actionpack/test/dispatch/mount_test.rb, line 63
def test_mounting_sets_script_name
  get "/sprockets/omg"
  assert_equal "/sprockets -- /omg", response.body
end
test_mounting_with_shorthand() click to toggle source
# File actionpack/test/dispatch/mount_test.rb, line 78
def test_mounting_with_shorthand
  get "/shorthand/omg"
  assert_equal "/shorthand -- /omg", response.body
end
test_mounting_works_with_nested_script_name() click to toggle source
# File actionpack/test/dispatch/mount_test.rb, line 68
def test_mounting_works_with_nested_script_name
  get "/foo/sprockets/omg", headers: { "SCRIPT_NAME" => "/foo", "PATH_INFO" => "/sprockets/omg" }
  assert_equal "/foo/sprockets -- /omg", response.body
end
test_mounting_works_with_scope() click to toggle source
# File actionpack/test/dispatch/mount_test.rb, line 73
def test_mounting_works_with_scope
  get "/its_a/sprocket/omg"
  assert_equal "/its_a/sprocket -- /omg", response.body
end
test_mounting_works_with_via() click to toggle source
# File actionpack/test/dispatch/mount_test.rb, line 83
def test_mounting_works_with_via
  get "/getfake"
  assert_equal "OK", response.body

  post "/getfake"
  assert_response :not_found
end
test_with_fake_engine_does_not_call_invalid_method() click to toggle source
# File actionpack/test/dispatch/mount_test.rb, line 91
def test_with_fake_engine_does_not_call_invalid_method
  get "/fakeengine"
  assert_equal "OK", response.body
end