diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-08-31 23:08:20 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-08-31 23:08:20 -0500 |
commit | a79790e1a5733694baef3d03d8d79b76948a9d69 (patch) | |
tree | 9c6df0ceaf39700bcfa906d54c64b1621f9fb245 /actionpack/lib/action_controller/testing | |
parent | 426e76ad85c060ef2fa87bc2bebfc906ea7b090e (diff) | |
download | rails-a79790e1a5733694baef3d03d8d79b76948a9d69.tar.gz rails-a79790e1a5733694baef3d03d8d79b76948a9d69.tar.bz2 rails-a79790e1a5733694baef3d03d8d79b76948a9d69.zip |
rack-test 0.4.2 has rack 1.1.pre goodies, we'll use it instead
Diffstat (limited to 'actionpack/lib/action_controller/testing')
-rw-r--r-- | actionpack/lib/action_controller/testing/integration.rb | 14 | ||||
-rw-r--r-- | actionpack/lib/action_controller/testing/process.rb | 2 |
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) |