aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/rack_test.rb
diff options
context:
space:
mode:
authorEugene Pimenov <libc@mac.com>2009-02-05 07:33:34 +0300
committerJeremy Kemper <jeremy@bitsweat.net>2009-02-06 10:28:09 -0800
commitae36fcedce1ffcf4f3331b444ea1779987c6615a (patch)
treeaf334b3e2df229d4e59acdfdb537be3fb01ec11b /actionpack/test/controller/rack_test.rb
parent55812291952382fd29be57a9806c151f43cf1c43 (diff)
downloadrails-ae36fcedce1ffcf4f3331b444ea1779987c6615a.tar.gz
rails-ae36fcedce1ffcf4f3331b444ea1779987c6615a.tar.bz2
rails-ae36fcedce1ffcf4f3331b444ea1779987c6615a.zip
Ruby 1.9 compat: call bytesize for content_length
[#1881 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'actionpack/test/controller/rack_test.rb')
-rw-r--r--actionpack/test/controller/rack_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/test/controller/rack_test.rb b/actionpack/test/controller/rack_test.rb
index e458ab6738..36ca205d8e 100644
--- a/actionpack/test/controller/rack_test.rb
+++ b/actionpack/test/controller/rack_test.rb
@@ -228,6 +228,21 @@ class RackResponseTest < BaseRackTest
assert_equal ["Hello, World!"], parts
end
+ def test_utf8_output
+ @response.body = [1090, 1077, 1089, 1090].pack("U*")
+ @response.prepare!
+
+ status, headers, body = @response.to_a
+ assert_equal 200, status
+ assert_equal({
+ "Content-Type" => "text/html; charset=utf-8",
+ "Cache-Control" => "private, max-age=0, must-revalidate",
+ "ETag" => '"ebb5e89e8a94e9dd22abf5d915d112b2"',
+ "Set-Cookie" => [],
+ "Content-Length" => "8"
+ }, headers)
+ end
+
def test_streaming_block
@response.body = Proc.new do |response, output|
5.times { |n| output.write(n) }