aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-12-11 15:58:11 -0800
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-12-11 15:58:11 -0800
commitd176af3250ef1d73d5ce3e7aa23dfe9d1dc4e40f (patch)
tree3e60202f68cab940fa265fa207e97f75af6c6dd0 /actionpack/test
parent5353795c0d8d9b4c8d237548500d69d9f87c3c8d (diff)
parent991601ff6e99139e7731212d5ac87385f943fb47 (diff)
downloadrails-d176af3250ef1d73d5ce3e7aa23dfe9d1dc4e40f.tar.gz
rails-d176af3250ef1d73d5ce3e7aa23dfe9d1dc4e40f.tar.bz2
rails-d176af3250ef1d73d5ce3e7aa23dfe9d1dc4e40f.zip
Merge pull request #8490 from mattv/fix_request_raw_post
Fix rewinding in ActionDispatch::Request#raw_post
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/request_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb
index f2bacf3e20..263853fb6c 100644
--- a/actionpack/test/dispatch/request_test.rb
+++ b/actionpack/test/dispatch/request_test.rb
@@ -650,6 +650,13 @@ class RequestTest < ActiveSupport::TestCase
assert_equal Mime::XML, request.negotiate_mime([Mime::XML, Mime::CSV])
end
+ test "raw_post rewinds rack.input if RAW_POST_DATA is nil" do
+ request = stub_request('rack.input' => StringIO.new("foo"),
+ 'CONTENT_LENGTH' => 3)
+ assert_equal "foo", request.raw_post
+ assert_equal "foo", request.env['rack.input'].read
+ end
+
test "process parameter filter" do
test_hashes = [
[{'foo'=>'bar'},{'foo'=>'bar'},%w'food'],