Skip to content

Commit

Permalink
pass the session and env in to the test request
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Jul 8, 2015
1 parent 460079a commit 3806eb7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions actionpack/lib/action_controller/test_case.rb
Expand Up @@ -10,10 +10,14 @@ class TestRequest < ActionDispatch::TestRequest #:nodoc:
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

Expand Down Expand Up @@ -524,7 +528,7 @@ def setup_controller_request_and_response
end

def build_request
TestRequest.new
TestRequest.new({}, TestRequest.new_session)
end

def build_response(klass)
Expand Down

0 comments on commit 3806eb7

Please sign in to comment.