diff options
author | kennyj <kennyj@gmail.com> | 2012-06-06 00:59:01 +0900 |
---|---|---|
committer | kennyj <kennyj@gmail.com> | 2012-06-16 00:22:16 +0900 |
commit | c42a7a0082a16b47b6bb6d1b919a4b5ec6e7860d (patch) | |
tree | 2daff0c583cedf45ef5d8dc7da23ac8582147c63 /actionpack/test | |
parent | c1b1956a15d3d38d0a4504e168bb69638d71e536 (diff) | |
download | rails-c42a7a0082a16b47b6bb6d1b919a4b5ec6e7860d.tar.gz rails-c42a7a0082a16b47b6bb6d1b919a4b5ec6e7860d.tar.bz2 rails-c42a7a0082a16b47b6bb6d1b919a4b5ec6e7860d.zip |
Support unicode character route in config/routes.rb.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 5 | ||||
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 306b8a93da..6cc1370105 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -1760,6 +1760,7 @@ class RackMountIntegrationTests < ActiveSupport::TestCase get 'account(/:action)' => "account#subscription" get 'pages/:page_id/:controller(/:action(/:id))' get ':controller/ping', :action => 'ping' + get 'こんにちは/世界', :controller => 'news', :action => 'index' match ':controller(/:action(/:id))(.:format)', :via => :all root :to => "news#index" } @@ -1876,6 +1877,10 @@ class RackMountIntegrationTests < ActiveSupport::TestCase assert_equal({:controller => 'people', :action => 'create', :person => { :name => 'Josh'}}, params) end + def test_unicode_path + assert_equal({:controller => 'news', :action => 'index'}, @routes.recognize_path(URI.parser.escape('こんにちは/世界'), :method => :get)) + end + private def sort_extras!(extras) if extras.length == 2 diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index fa4cb301eb..f15dd7214b 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -2472,7 +2472,7 @@ end class TestUnicodePaths < ActionDispatch::IntegrationTest Routes = ActionDispatch::Routing::RouteSet.new.tap do |app| app.draw do - get "/#{Rack::Utils.escape("ほげ")}" => lambda { |env| + get "/ほげ" => lambda { |env| [200, { 'Content-Type' => 'text/plain' }, []] }, :as => :unicode_path end @@ -2727,4 +2727,4 @@ class TestInvalidUrls < ActionDispatch::IntegrationTest assert_response :bad_request end end -end
\ No newline at end of file +end |