From 3cae6bc5fc8765b5a06fd3d123528159d1f850b7 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 8 Jul 2015 15:17:50 -0700 Subject: pass the starting env and session to build_request --- actionpack/lib/action_controller/test_case.rb | 6 +++--- actionpack/lib/action_dispatch/testing/assertions/routing.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index d303aafdd9..49a6d1c145 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -516,7 +516,7 @@ module ActionController end end - @request = build_request + @request = build_request({}, TestRequest.new_session) @request.env["rack.request.cookie_hash"] = {}.with_indifferent_access @response = build_response @response_klass @response.request = @request @@ -527,8 +527,8 @@ module ActionController end end - def build_request - TestRequest.new({}, TestRequest.new_session) + def build_request(env, session) + TestRequest.new(env, session) end def build_response(klass) diff --git a/actionpack/lib/action_dispatch/testing/assertions/routing.rb b/actionpack/lib/action_dispatch/testing/assertions/routing.rb index 4ea0cd68ac..48765fe83c 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/routing.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/routing.rb @@ -183,7 +183,7 @@ module ActionDispatch end # Assume given controller - request = build_request + request = build_request({}, ActionController::TestRequest.new_session) if path =~ %r{://} fail_on(URI::InvalidURIError, msg) do -- cgit v1.2.3