aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/test_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb
index dcb16841ae..25c514d5a3 100644
--- a/actionpack/test/controller/test_test.rb
+++ b/actionpack/test/controller/test_test.rb
@@ -8,6 +8,11 @@ class TestTest < Test::Unit::TestCase
render :text => 'ignore me'
end
+ def render_raw_post
+ raise Test::Unit::AssertionFailedError, "#raw_post is blank" if request.raw_post.blank?
+ render :text => request.raw_post
+ end
+
def test_params
render :text => params.inspect
end
@@ -44,6 +49,10 @@ HTML
def test_remote_addr
render :text => (request.remote_addr || "not specified")
end
+
+ def rescue_action(e)
+ raise e
+ end
end
def setup
@@ -57,6 +66,14 @@ HTML
ActionController::Routing::Routes.reload
end
+ def test_raw_post_handling
+ params = {:page => {:name => 'page name'}, 'some key' => 123}
+ get :render_raw_post, params.dup
+
+ raw_post = params.map {|k,v| [CGI::escape(k.to_s), CGI::escape(v.to_s)].join('=')}.sort.join('&')
+ assert_equal raw_post, @response.body
+ end
+
def test_process_without_flash
process :set_flash
assert_equal '><', flash['test']