From 3806eb70a63f0252c88ebb25f0aa79b4c0ca5686 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 8 Jul 2015 14:32:54 -0700 Subject: pass the session and env in to the test request --- actionpack/lib/action_controller/test_case.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 5489a0fde0..d303aafdd9 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -10,10 +10,14 @@ module ActionController DEFAULT_ENV = ActionDispatch::TestRequest::DEFAULT_ENV.dup DEFAULT_ENV.delete 'PATH_INFO' - def initialize(env = {}) - super + def self.new_session + TestSession.new + end + + def initialize(env, session) + super(env) - self.session = TestSession.new + self.session = session self.session_options = TestSession::DEFAULT_OPTIONS end @@ -524,7 +528,7 @@ module ActionController end def build_request - TestRequest.new + TestRequest.new({}, TestRequest.new_session) end def build_response(klass) -- cgit v1.2.3