Commit 4bb742553258fea73ff50b1c4ef285fdcf8bcfda

Authored by AntonioTerceiro
1 parent 1bc3ce6b

r218@sede: terceiro | 2007-07-28 11:43:26 -0300

ActionItem0: putting edit_template under customize/
 


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@222 3f533792-8f58-4932-b0fe-aaf55b0a4547
config/routes.rb
... ... @@ -19,8 +19,8 @@ ActionController::Routing::Routes.draw do |map|
19 19 # user account controller
20 20 map.connect 'account/:action', :controller => 'account'
21 21  
22   - # TODO: profile customization for profiles
23   - # map.connect 'customize/:profile/:controller/:action/:id'
  22 + # profile customization
  23 + map.connect 'customize/:profile/edit_template/:action/:id', :controller => 'edit_template'
24 24  
25 25 # content administration
26 26 map.comatose_admin 'cms/:profile'
... ... @@ -28,7 +28,9 @@ ActionController::Routing::Routes.draw do |map|
28 28 # administrative tasks for a virtual community
29 29 map.connect 'admin/:controller/:action/:id'
30 30  
31   - # content viewing:
  31 +
  32 + # *content viewing*
  33 + # XXX this route must come last so other tasks have priority over it.
32 34 map.connect ':profile/*page', :controller => 'content_viewer', :action => 'view_page'
33 35  
34 36 # no default route
... ...
test/integration/routing_test.rb
... ... @@ -2,16 +2,22 @@ require "#{File.dirname(__FILE__)}/../test_helper"
2 2  
3 3 class RoutingTest < ActionController::IntegrationTest
4 4  
  5 + # home page
  6 + ################################################################
5 7 def test_homepage
6 8 assert_routing('/', :controller => 'home', :action => 'index')
7 9 end
8 10  
  11 + # auxiliary (development) controllers
  12 + ################################################################
9 13 def test_doc_controller
10 14 #FIXME: assert_routing cannot find controllers in plugins'
11 15 flunk 'FIXME: assert_routing cannot find controllers in plugins'
12 16 assert_routing('/doc', :controller => 'doc', :action => 'index')
13 17 end
14 18  
  19 + # user-targeted controllers (account/*, cms/*, customize/*)
  20 + ################################################################
15 21 def test_account_controller
16 22 assert_routing('/account', :controller => 'account', :action => 'index')
17 23 end
... ... @@ -22,10 +28,21 @@ class RoutingTest &lt; ActionController::IntegrationTest
22 28 assert_routing('/cms/ze', :controller => 'comatose_admin')
23 29 end
24 30  
  31 + def test_edit_template
  32 + assert_routing('/customize/ze/edit_template', :controller => 'edit_template', :action => 'index', :profile => 'ze')
  33 + end
  34 +
  35 + # virtual community administrative controllers (admin/*)
  36 + ################################################################
25 37 def test_features_controller
26 38 assert_routing('/admin/features', :controller => 'features', :action => 'index')
27 39 end
28 40  
  41 + # platform administrative conttollers (metaadmin/*)
  42 + ################################################################
  43 +
  44 + # external public controllers
  45 + ################################################################
29 46 def test_content_viewer
30 47  
31 48 # profile root:
... ...