Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

switch to the `serve` method so we can remove the request class (even…

…tually)
  • Loading branch information...
commit 6ed5b01f97cd6551e0072a9fb603f9c2487419ba 1 parent f117544
@tenderlove tenderlove authored
View
6 actionpack/lib/action_dispatch/journey/router.rb
@@ -29,12 +29,6 @@ def initialize(routes, options)
@routes = routes
end
- def call(env)
- req = request_class.new(env)
- req.path_info = Utils.normalize_path(req.path_info)
- serve req
- end
-
def serve(req)
find_routes(req).each do |match, parameters, route|
set_params = req.path_parameters
View
8 actionpack/test/journey/router_test.rb
@@ -213,7 +213,7 @@ def test_knows_what_parts_are_missing_from_named_route
def test_X_Cascade
add_routes @router, [ "/messages(.:format)" ]
- resp = @router.call({ 'REQUEST_METHOD' => 'GET', 'PATH_INFO' => '/lol' })
+ resp = @router.serve(make_req({ 'REQUEST_METHOD' => 'GET', 'PATH_INFO' => '/lol' }))
assert_equal ['Not Found'], resp.last
assert_equal 'pass', resp[1]['X-Cascade']
assert_equal 404, resp.first
@@ -226,7 +226,7 @@ def test_clear_trailing_slash_from_script_name_on_root_unanchored_routes
@router.routes.add_route(app, path, {}, {}, {})
env = rack_env('SCRIPT_NAME' => '', 'PATH_INFO' => '/weblog')
- resp = @router.call(env)
+ resp = @router.serve make_req env
assert_equal ['success!'], resp.last
assert_equal '', env['SCRIPT_NAME']
end
@@ -571,6 +571,10 @@ def rails_env env
RailsEnv.new rack_env env
end
+ def make_req env
+ ActionDispatch::Request.new env
+ end
+
def rack_env env
{
"rack.version" => [1, 1],
Please sign in to comment.
Something went wrong with that request. Please try again.