Skip to content
Browse files

Merge pull request #4658 from pwim/unicode-paths

Test for unicode path support
  • Loading branch information...
2 parents 9e9e17a + 22980e0 commit 11e88a465c904069dad4d42b42959fe03a263042 @tenderlove tenderlove committed Jan 25, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 actionpack/test/dispatch/routing_test.rb
View
20 actionpack/test/dispatch/routing_test.rb
@@ -1,3 +1,4 @@
+# encoding: UTF-8
require 'erb'
require 'abstract_unit'
require 'controller/fake_controllers'
@@ -2542,3 +2543,22 @@ def app; Routes end
assert_equal 'a b/c+d', @response.body
end
end
+
+class TestUnicodePaths < ActionDispatch::IntegrationTest
+ Routes = ActionDispatch::Routing::RouteSet.new.tap do |app|
+ app.draw do
+ match "/#{Rack::Utils.escape("ほげ")}" => lambda { |env|
+ path_params = env['action_dispatch.request.path_parameters']
+ [200, { 'Content-Type' => 'text/plain' }, []]
+ }, :as => :unicode_path
+ end
+ end
+
+ include Routes.url_helpers
+ def app; Routes end
+
+ test 'recognizes unicode path' do
+ get "/#{Rack::Utils.escape("ほげ")}"
+ assert_equal "200", @response.code
+ end
+end

0 comments on commit 11e88a4

Please sign in to comment.
Something went wrong with that request. Please try again.