diff options
Diffstat (limited to 'actionpack/test/controller/routing_test.rb')
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 2f552c3a5a..6cc1370105 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -270,6 +270,16 @@ class LegacyRouteSetTests < ActiveSupport::TestCase end end + def test_specific_controller_action_failure + @rs.draw do + mount lambda {} => "/foo" + end + + assert_raises(ActionController::RoutingError) do + url_for(@rs, :controller => "omg", :action => "lol") + end + end + def test_default_setup @rs.draw { get '/:controller(/:action(/:id))' } assert_equal({:controller => "content", :action => 'index'}, rs.recognize_path("/content")) @@ -1750,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" } @@ -1866,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 |