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,8 +19,8 @@ ActionController::Routing::Routes.draw do |map|
19 # user account controller 19 # user account controller
20 map.connect 'account/:action', :controller => 'account' 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 # content administration 25 # content administration
26 map.comatose_admin 'cms/:profile' 26 map.comatose_admin 'cms/:profile'
@@ -28,7 +28,9 @@ ActionController::Routing::Routes.draw do |map| @@ -28,7 +28,9 @@ ActionController::Routing::Routes.draw do |map|
28 # administrative tasks for a virtual community 28 # administrative tasks for a virtual community
29 map.connect 'admin/:controller/:action/:id' 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 map.connect ':profile/*page', :controller => 'content_viewer', :action => 'view_page' 34 map.connect ':profile/*page', :controller => 'content_viewer', :action => 'view_page'
33 35
34 # no default route 36 # no default route
test/integration/routing_test.rb
@@ -2,16 +2,22 @@ require "#{File.dirname(__FILE__)}/../test_helper" @@ -2,16 +2,22 @@ require "#{File.dirname(__FILE__)}/../test_helper"
2 2
3 class RoutingTest < ActionController::IntegrationTest 3 class RoutingTest < ActionController::IntegrationTest
4 4
  5 + # home page
  6 + ################################################################
5 def test_homepage 7 def test_homepage
6 assert_routing('/', :controller => 'home', :action => 'index') 8 assert_routing('/', :controller => 'home', :action => 'index')
7 end 9 end
8 10
  11 + # auxiliary (development) controllers
  12 + ################################################################
9 def test_doc_controller 13 def test_doc_controller
10 #FIXME: assert_routing cannot find controllers in plugins' 14 #FIXME: assert_routing cannot find controllers in plugins'
11 flunk 'FIXME: assert_routing cannot find controllers in plugins' 15 flunk 'FIXME: assert_routing cannot find controllers in plugins'
12 assert_routing('/doc', :controller => 'doc', :action => 'index') 16 assert_routing('/doc', :controller => 'doc', :action => 'index')
13 end 17 end
14 18
  19 + # user-targeted controllers (account/*, cms/*, customize/*)
  20 + ################################################################
15 def test_account_controller 21 def test_account_controller
16 assert_routing('/account', :controller => 'account', :action => 'index') 22 assert_routing('/account', :controller => 'account', :action => 'index')
17 end 23 end
@@ -22,10 +28,21 @@ class RoutingTest &lt; ActionController::IntegrationTest @@ -22,10 +28,21 @@ class RoutingTest &lt; ActionController::IntegrationTest
22 assert_routing('/cms/ze', :controller => 'comatose_admin') 28 assert_routing('/cms/ze', :controller => 'comatose_admin')
23 end 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 def test_features_controller 37 def test_features_controller
26 assert_routing('/admin/features', :controller => 'features', :action => 'index') 38 assert_routing('/admin/features', :controller => 'features', :action => 'index')
27 end 39 end
28 40
  41 + # platform administrative conttollers (metaadmin/*)
  42 + ################################################################
  43 +
  44 + # external public controllers
  45 + ################################################################
29 def test_content_viewer 46 def test_content_viewer
30 47
31 # profile root: 48 # profile root: