diff --git a/config/routes.rb b/config/routes.rb index 17c0f13..be69940 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -53,7 +53,9 @@ ActionController::Routing::Routes.draw do |map| ###################################################### ## Public controllers ###################################################### - + + map.connect 'cat/:action/*path', :controller => 'category', :action => 'index' + # *content viewing* # XXX this route must come last so other routes have priority over it. map.homepage ':profile/*page', :controller => 'content_viewer', :action => 'view_page' diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index 93cb94a..772f519 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -50,6 +50,12 @@ class RoutingTest < ActionController::IntegrationTest assert_routing('/admin/manage_tags', :controller => 'manage_tags', :action => 'index') end + def test_categories_management + assert_routing('/admin/categories', :controller => 'categories', :action => 'index') + assert_routing('/admin/categories/new', :controller => 'categories', :action => 'new') + assert_routing('/admin/categories/edit/2', :controller => 'categories', :action => 'edit', :id => '2') + end + # platform administrative controllers (system/*) ################################################################ @@ -64,4 +70,9 @@ class RoutingTest < ActionController::IntegrationTest assert_routing('/ze/work/2007', :controller => 'content_viewer', :action => 'view_page', :profile => 'ze', :page => ['work', "2007"]) end + def test_category_browser + assert_routing('/cat/some_action/products/eletronics', :controller => 'category', :action => 'some_action', :path => [ 'products', 'eletronics']) + assert_routing('/cat', :controller => 'category', :action => 'index', :path => [ ]) + end + end -- libgit2 0.21.2