diff options
author | Paul McMahon <paul@mobalean.com> | 2012-01-25 15:27:33 +0900 |
---|---|---|
committer | Paul McMahon <paul@mobalean.com> | 2012-01-25 15:27:33 +0900 |
commit | 22980e0c172641860420dcddab6809bcee29f25e (patch) | |
tree | 28591e6287ca60bca728be8a3f6800ed8a7d7c54 /actionpack/test | |
parent | 1d67f1ade761db75bceb30d914c4280cc3dbc984 (diff) | |
download | rails-22980e0c172641860420dcddab6809bcee29f25e.tar.gz rails-22980e0c172641860420dcddab6809bcee29f25e.tar.bz2 rails-22980e0c172641860420dcddab6809bcee29f25e.zip |
Test for unicode path support
This is currently broken due to a bug in journey.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 4517e9f2b3..207a439a0a 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/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 @@ class TestUriPathEscaping < ActionDispatch::IntegrationTest 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 |