diff options
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/send_file_test.rb | 12 |
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 |