aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/testing/integration.rb14
-rw-r--r--actionpack/lib/action_controller/testing/process.rb2
2 files changed, 7 insertions, 9 deletions
diff --git a/actionpack/lib/action_controller/testing/integration.rb b/actionpack/lib/action_controller/testing/integration.rb
index fb82f866fe..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,
@@ -268,18 +266,18 @@ module ActionController
"HTTP_ACCEPT" => accept
}
- env = ActionDispatch::TestRequest.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
diff --git a/actionpack/lib/action_controller/testing/process.rb b/actionpack/lib/action_controller/testing/process.rb
index a58b2de379..5fb244e3eb 100644
--- a/actionpack/lib/action_controller/testing/process.rb
+++ b/actionpack/lib/action_controller/testing/process.rb
@@ -84,7 +84,7 @@ module ActionController #:nodoc:
#
# Pass a true third parameter to ensure the uploaded file is opened in binary mode (only required for Windows):
# post :change_avatar, :avatar => ActionController::TestUploadedFile.new(ActionController::TestCase.fixture_path + '/files/spongebob.png', 'image/png', :binary)
- TestUploadedFile = ActionDispatch::TestRequest::Multipart::UploadedFile
+ TestUploadedFile = Rack::Test::UploadedFile
module TestProcess
def self.included(base)