aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/journey/router.rb6
-rw-r--r--actionpack/test/journey/router_test.rb8
2 files changed, 6 insertions, 8 deletions
diff --git a/actionpack/lib/action_dispatch/journey/router.rb b/actionpack/lib/action_dispatch/journey/router.rb
index d64d0923e9..218c9e9d55 100644
--- a/actionpack/lib/action_dispatch/journey/router.rb
+++ b/actionpack/lib/action_dispatch/journey/router.rb
@@ -29,12 +29,6 @@ module ActionDispatch
@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
diff --git a/actionpack/test/journey/router_test.rb b/actionpack/test/journey/router_test.rb
index b95f4c169b..d37fe1c625 100644
--- a/actionpack/test/journey/router_test.rb
+++ b/actionpack/test/journey/router_test.rb
@@ -213,7 +213,7 @@ module ActionDispatch
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 @@ module ActionDispatch
@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 @@ module ActionDispatch
RailsEnv.new rack_env env
end
+ def make_req env
+ ActionDispatch::Request.new env
+ end
+
def rack_env env
{
"rack.version" => [1, 1],