diff options
Diffstat (limited to 'actionpack/lib/action_controller/testing/integration.rb')
-rw-r--r-- | actionpack/lib/action_controller/testing/integration.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/actionpack/lib/action_controller/testing/integration.rb b/actionpack/lib/action_controller/testing/integration.rb index 5cb0f48f82..e7104e5c3d 100644 --- a/actionpack/lib/action_controller/testing/integration.rb +++ b/actionpack/lib/action_controller/testing/integration.rb @@ -2,9 +2,7 @@ require 'stringio' require 'uri' require 'active_support/test_case' require 'active_support/core_ext/object/metaclass' - -require 'rack/mock_session' -require 'rack/test/cookie_jar' +require 'rack/test' module ActionController module Integration #:nodoc: @@ -251,7 +249,7 @@ module ActionController end end - opts = { + env = { :method => method, :params => parameters, @@ -267,18 +265,19 @@ module ActionController "CONTENT_TYPE" => "application/x-www-form-urlencoded", "HTTP_ACCEPT" => accept } - env = Rack::MockRequest.env_for(path, opts) (rack_environment || {}).each do |key, value| env[key] = value end + session = Rack::Test::Session.new(@mock_session) + @controller = ActionController::Base.capture_instantiation do - @mock_session.request(URI.parse(path), env) + session.request(path, env) end @request_count += 1 - @request = ActionDispatch::Request.new(env) + @request = ActionDispatch::Request.new(session.last_request.env) @response = ActionDispatch::TestResponse.from_response(@mock_session.last_response) @html_document = nil |