diff --git a/config/routes.rb b/config/routes.rb index d4e59de..57ad251 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -19,8 +19,8 @@ ActionController::Routing::Routes.draw do |map| # user account controller map.connect 'account/:action', :controller => 'account' - # TODO: profile customization for profiles - # map.connect 'customize/:profile/:controller/:action/:id' + # profile customization + map.connect 'customize/:profile/edit_template/:action/:id', :controller => 'edit_template' # content administration map.comatose_admin 'cms/:profile' @@ -28,7 +28,9 @@ ActionController::Routing::Routes.draw do |map| # administrative tasks for a virtual community map.connect 'admin/:controller/:action/:id' - # content viewing: + + # *content viewing* + # XXX this route must come last so other tasks have priority over it. map.connect ':profile/*page', :controller => 'content_viewer', :action => 'view_page' # no default route diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index 2481f3e..8da57f2 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -2,16 +2,22 @@ require "#{File.dirname(__FILE__)}/../test_helper" class RoutingTest < ActionController::IntegrationTest + # home page + ################################################################ def test_homepage assert_routing('/', :controller => 'home', :action => 'index') end + # auxiliary (development) controllers + ################################################################ def test_doc_controller #FIXME: assert_routing cannot find controllers in plugins' flunk 'FIXME: assert_routing cannot find controllers in plugins' assert_routing('/doc', :controller => 'doc', :action => 'index') end + # user-targeted controllers (account/*, cms/*, customize/*) + ################################################################ def test_account_controller assert_routing('/account', :controller => 'account', :action => 'index') end @@ -22,10 +28,21 @@ class RoutingTest < ActionController::IntegrationTest assert_routing('/cms/ze', :controller => 'comatose_admin') end + def test_edit_template + assert_routing('/customize/ze/edit_template', :controller => 'edit_template', :action => 'index', :profile => 'ze') + end + + # virtual community administrative controllers (admin/*) + ################################################################ def test_features_controller assert_routing('/admin/features', :controller => 'features', :action => 'index') end + # platform administrative conttollers (metaadmin/*) + ################################################################ + + # external public controllers + ################################################################ def test_content_viewer # profile root: -- libgit2 0.21.2