diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-16 03:15:12 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-16 03:15:12 +0000 |
commit | 275ea6de499c009e51fbe4c1abcfa4f50bdfeb12 (patch) | |
tree | 0fe9223dd08fc18d77f4662e6bbfd5f6a01acbcb /actionpack/lib | |
parent | c3c69d90626dd5ac16231b1d53615547df678f76 (diff) | |
download | rails-275ea6de499c009e51fbe4c1abcfa4f50bdfeb12.tar.gz rails-275ea6de499c009e51fbe4c1abcfa4f50bdfeb12.tar.bz2 rails-275ea6de499c009e51fbe4c1abcfa4f50bdfeb12.zip |
Added TestRequest#raw_post that simulate raw_post from CgiRequest (closes #3042) [francois.beausoleil@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3888 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/test_process.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb index 7dfc16785a..85bcc7372d 100644 --- a/actionpack/lib/action_controller/test_process.rb +++ b/actionpack/lib/action_controller/test_process.rb @@ -41,7 +41,17 @@ module ActionController #:nodoc: def reset_session @session = {} end + + def raw_post + params = self.request_parameters.dup + %w(controller action only_path).each do |k| + params.delete(k) + params.delete(k.to_sym) + end + params.map { |k,v| [ CGI.escape(k.to_s), CGI.escape(v.to_s) ].join('=') }.sort.join('&') + end + def port=(number) @env["SERVER_PORT"] = number.to_i @port_as_int = nil |