aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2012-02-05 06:27:01 -0800
committerJosé Valim <jose.valim@plataformatec.com.br>2012-02-05 06:27:01 -0800
commitb0d05f4bee6960b70d0ef46f44390a796f19c9d5 (patch)
tree8fc2e58a231da209922859bb80d0dc9b025bfaec
parentbb4de3a54c3a74800d7204547bc00e76dc9ee5fb (diff)
parent1ec5c2674fd792e8f9ddbff5afcacc3e1f7c506d (diff)
downloadrails-b0d05f4bee6960b70d0ef46f44390a796f19c9d5.tar.gz
rails-b0d05f4bee6960b70d0ef46f44390a796f19c9d5.tar.bz2
rails-b0d05f4bee6960b70d0ef46f44390a796f19c9d5.zip
Merge pull request #4888 from kennyj/fix_2982
Add a testcase for non english filename. Related to #2982.
-rw-r--r--actionpack/test/dispatch/static_test.rb7
-rw-r--r--actionpack/test/fixtures/public/foo/こんにちは.html1
2 files changed, 7 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/static_test.rb b/actionpack/test/dispatch/static_test.rb
index 9f3cbd19ef..b7a53353a9 100644
--- a/actionpack/test/dispatch/static_test.rb
+++ b/actionpack/test/dispatch/static_test.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
require 'abstract_unit'
module StaticTests
@@ -30,6 +31,10 @@ module StaticTests
assert_html "/foo/index.html", get("/foo")
end
+ def test_served_static_file_with_non_english_filename
+ assert_html "means hello in Japanese\n", get("/foo/#{Rack::Utils.escape("こんにちは.html")}")
+ end
+
private
def assert_html(body, response)
@@ -53,4 +58,4 @@ class StaticTest < ActiveSupport::TestCase
end
include StaticTests
-end \ No newline at end of file
+end
diff --git a/actionpack/test/fixtures/public/foo/こんにちは.html b/actionpack/test/fixtures/public/foo/こんにちは.html
new file mode 100644
index 0000000000..1df9166522
--- /dev/null
+++ b/actionpack/test/fixtures/public/foo/こんにちは.html
@@ -0,0 +1 @@
+means hello in Japanese