aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorSava Chankov <sava@tutuf.com>2009-08-01 19:38:05 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-08-01 20:25:59 -0700
commitec94c2550dae463e646a18316bfcdaded9d140c9 (patch)
tree2c4dec32f672ab83a5e88587c5757f6110da9ad8 /actionpack/test/controller
parenta606727606cc0725a39748dd9d310b2b064e3ca7 (diff)
downloadrails-ec94c2550dae463e646a18316bfcdaded9d140c9.tar.gz
rails-ec94c2550dae463e646a18316bfcdaded9d140c9.tar.bz2
rails-ec94c2550dae463e646a18316bfcdaded9d140c9.zip
Ruby 1.9: fix Content-Length for multibyte send_data streaming
[#2661 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/send_file_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb
index ae32ee5649..154daad1b9 100644
--- a/actionpack/test/controller/send_file_test.rb
+++ b/actionpack/test/controller/send_file_test.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
require 'abstract_unit'
module TestFileUtils
@@ -22,6 +23,10 @@ class SendFileController < ActionController::Base
def data
send_data(file_data, options)
end
+
+ def multibyte_text_data
+ send_data("Кирилица\n祝您好運", options)
+ end
end
class SendFileTest < ActionController::TestCase
@@ -163,4 +168,11 @@ class SendFileTest < ActionController::TestCase
assert_equal 200, @response.status
end
end
+
+ def test_send_data_content_length_header
+ @controller.headers = {}
+ @controller.options = { :type => :text, :filename => 'file_with_utf8_text' }
+ process('multibyte_text_data')
+ assert_equal '29', @controller.headers['Content-Length']
+ end
end