aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/request/multipart_params_parsing_test.rb
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2015-08-24 06:05:07 +0000
committerVijay Dev <vijaydev.cse@gmail.com>2015-08-24 06:05:07 +0000
commit4f252cddc1ee4e28c633a2250335b2fac4d31108 (patch)
tree776177555c7039204e23c9c1b7d33b700d366ca3 /actionpack/test/dispatch/request/multipart_params_parsing_test.rb
parentbc36ffeec05692777f4ece09978a321feed2d818 (diff)
parent06818cb9a8cee8c95eaebdd1418e6fcb0da9382e (diff)
downloadrails-4f252cddc1ee4e28c633a2250335b2fac4d31108.tar.gz
rails-4f252cddc1ee4e28c633a2250335b2fac4d31108.tar.bz2
rails-4f252cddc1ee4e28c633a2250335b2fac4d31108.zip
Merge branch 'master' of github.com:rails/rails
Conflicts: guides/source/security.md
Diffstat (limited to 'actionpack/test/dispatch/request/multipart_params_parsing_test.rb')
-rw-r--r--actionpack/test/dispatch/request/multipart_params_parsing_test.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/request/multipart_params_parsing_test.rb b/actionpack/test/dispatch/request/multipart_params_parsing_test.rb
index 50f69c53cb..b36fbd3c76 100644
--- a/actionpack/test/dispatch/request/multipart_params_parsing_test.rb
+++ b/actionpack/test/dispatch/request/multipart_params_parsing_test.rb
@@ -17,7 +17,7 @@ class MultipartParamsParsingTest < ActionDispatch::IntegrationTest
end
def read
- render :text => "File: #{params[:uploaded_data].read}"
+ render plain: "File: #{params[:uploaded_data].read}"
end
end
@@ -63,6 +63,17 @@ class MultipartParamsParsingTest < ActionDispatch::IntegrationTest
assert_equal 'contents', file.read
end
+ test "parses utf8 filename with percent character" do
+ params = parse_multipart('utf8_filename')
+ assert_equal %w(file foo), params.keys.sort
+ assert_equal 'bar', params['foo']
+
+ file = params['file']
+ assert_equal 'ファイル%名.txt', file.original_filename
+ assert_equal "text/plain", file.content_type
+ assert_equal 'contents', file.read
+ end
+
test "parses boundary problem file" do
params = parse_multipart('boundary_problem_file')
assert_equal %w(file foo), params.keys.sort