aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/testing/process.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-05-02 15:29:18 -0500
committerJoshua Peek <josh@joshpeek.com>2009-05-02 15:29:18 -0500
commitf32cf44870549c6cc5b6e6c84cffc1facf6ec38e (patch)
tree320e7398d1e6e4f3f372cd2ee90d1e2560459f10 /actionpack/lib/action_controller/testing/process.rb
parenta8b75c480fc9774252f5976dcf1a614079822e56 (diff)
downloadrails-f32cf44870549c6cc5b6e6c84cffc1facf6ec38e.tar.gz
rails-f32cf44870549c6cc5b6e6c84cffc1facf6ec38e.tar.bz2
rails-f32cf44870549c6cc5b6e6c84cffc1facf6ec38e.zip
Switch functional tests to run through the rack interface instead of process
Diffstat (limited to 'actionpack/lib/action_controller/testing/process.rb')
-rw-r--r--actionpack/lib/action_controller/testing/process.rb13
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