diff options
Diffstat (limited to 'actionpack/lib/action_controller/testing')
-rw-r--r-- | actionpack/lib/action_controller/testing/process.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/testing/process.rb b/actionpack/lib/action_controller/testing/process.rb index b44ec2f94b..49e8322491 100644 --- a/actionpack/lib/action_controller/testing/process.rb +++ b/actionpack/lib/action_controller/testing/process.rb @@ -35,12 +35,13 @@ module ActionController #:nodoc: end data = params.to_query - @env['CONTENT_LENGTH'] = data.length + @env['CONTENT_LENGTH'] = data.length.to_s @env['rack.input'] = StringIO.new(data) end def recycle! @env.delete_if { |k, v| k =~ /^(action_dispatch|rack)\.request/ } + @env.delete_if { |k, v| k =~ /^action_dispatch\.rescue/ } @env['action_dispatch.request.query_parameters'] = {} end end @@ -132,7 +133,15 @@ module ActionController #:nodoc: Base.class_eval { include ProcessWithTest } unless Base < ProcessWithTest - response = Rack::MockResponse.new(*@controller.process(@request, ActionDispatch::Response.new).to_a) + env = @request.env + app = @controller + + # TODO: Enable Lint + # app = Rack::Lint.new(app) + + status, headers, body = app.call(env) + response = Rack::MockResponse.new(status, headers, body) + @response.request, @response.template = @request, @controller.template @response.status, @response.headers, @response.body = response.status, response.headers, response.body @response |