diff options
author | José Valim <jose.valim@gmail.com> | 2011-06-14 08:13:15 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-06-14 08:13:15 -0700 |
commit | deff5977d4ef046106ab5537ffd2eaceceeb1b86 (patch) | |
tree | b7fe92fbb0af83d3fb757a09773a903105849182 /actionpack/test/dispatch/uploaded_file_test.rb | |
parent | 954359b9c260f0e1265237c20bb3e4834a11fb9a (diff) | |
parent | 383fd143bf6b81d3a1352ddaebb7b4e8beac8b37 (diff) | |
download | rails-deff5977d4ef046106ab5537ffd2eaceceeb1b86.tar.gz rails-deff5977d4ef046106ab5537ffd2eaceceeb1b86.tar.bz2 rails-deff5977d4ef046106ab5537ffd2eaceceeb1b86.zip |
Merge pull request #1689 from dmathieu/utf8-filename
Encode the uploaded file's name in utf8 - Closes #869
Diffstat (limited to 'actionpack/test/dispatch/uploaded_file_test.rb')
-rw-r--r-- | actionpack/test/dispatch/uploaded_file_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/uploaded_file_test.rb b/actionpack/test/dispatch/uploaded_file_test.rb index e2a7f1bad7..44c15694f7 100644 --- a/actionpack/test/dispatch/uploaded_file_test.rb +++ b/actionpack/test/dispatch/uploaded_file_test.rb @@ -12,6 +12,13 @@ module ActionDispatch uf = Http::UploadedFile.new(:filename => 'foo', :tempfile => Object.new) assert_equal 'foo', uf.original_filename end + + if "ruby".encoding_aware? + def test_filename_should_be_in_utf_8 + uf = Http::UploadedFile.new(:filename => 'foo', :tempfile => Object.new) + assert "UTF-8", uf.original_filename.encoding.to_s + end + end def test_content_type uf = Http::UploadedFile.new(:type => 'foo', :tempfile => Object.new) |