aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/new_base/render_body_test.rb
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2014-07-10 16:33:22 -0700
committerGodfrey Chan <godfreykfc@gmail.com>2014-07-10 16:33:22 -0700
commit013c74d645a5842ce35857e4f14af7fc9961c54d (patch)
treeb7fd3b8f210a9a503d2f9791625f63a183597797 /actionpack/test/controller/new_base/render_body_test.rb
parent6e76031e8f1f815b390f966cb21e25c66e5ded50 (diff)
downloadrails-013c74d645a5842ce35857e4f14af7fc9961c54d.tar.gz
rails-013c74d645a5842ce35857e4f14af7fc9961c54d.tar.bz2
rails-013c74d645a5842ce35857e4f14af7fc9961c54d.zip
Removed single space padding from empty response body.
`render nothing: true` or rendering a `nil` body no longer add a single space to the response body. The old behavior was added as a workaround for a bug in an early version of Safari, where the HTTP headers are not returned correctly if the response body has a 0-length. This is been fixed since and the workaround is no longer necessary. Use `render body: ' '` if the old behavior is desired.
Diffstat (limited to 'actionpack/test/controller/new_base/render_body_test.rb')
-rw-r--r--actionpack/test/controller/new_base/render_body_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/test/controller/new_base/render_body_test.rb b/actionpack/test/controller/new_base/render_body_test.rb
index fad848349a..f4a3db8b41 100644
--- a/actionpack/test/controller/new_base/render_body_test.rb
+++ b/actionpack/test/controller/new_base/render_body_test.rb
@@ -111,17 +111,17 @@ module RenderBody
assert_status 404
end
- test "rendering body with nil returns an empty body padded for Safari" do
+ test "rendering body with nil returns an empty body" do
get "/render_body/with_layout/with_nil"
- assert_body " "
+ assert_body ""
assert_status 200
end
- test "Rendering body with nil and custom status code returns an empty body padded for Safari and the status" do
+ test "Rendering body with nil and custom status code returns an empty body and the status" do
get "/render_body/with_layout/with_nil_and_status"
- assert_body " "
+ assert_body ""
assert_status 403
end