Commit ea278a0eb323733fac535f14f16afe9d590e99dc
1 parent
e6f4761f
Exists in
master
and in
29 other branches
ActionItem590: fix
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2330 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
10 additions
and
2 deletions
Show diff stats
config/routes.rb
| ... | ... | @@ -56,8 +56,8 @@ ActionController::Routing::Routes.draw do |map| |
| 56 | 56 | ## Controllers that are profile-specific (for profile admins ) |
| 57 | 57 | ###################################################### |
| 58 | 58 | # profile customization - "My profile" |
| 59 | - map.myprofile 'myprofile/:profile', :controller => 'profile_editor', :action => 'index' | |
| 60 | - map.myprofile 'myprofile/:profile/:controller/:action/:id', :controller => Noosfero.pattern_for_controllers_in_directory('my_profile') | |
| 59 | + map.myprofile 'myprofile/:profile', :controller => 'profile_editor', :action => 'index', :profile => /#{Noosfero.identifier_format}/ | |
| 60 | + map.myprofile 'myprofile/:profile/:controller/:action/:id', :controller => Noosfero.pattern_for_controllers_in_directory('my_profile'), :profile => /#{Noosfero.identifier_format}/ | |
| 61 | 61 | |
| 62 | 62 | |
| 63 | 63 | ###################################################### | ... | ... |
test/integration/routing_test.rb
| ... | ... | @@ -27,6 +27,10 @@ class RoutingTest < ActionController::IntegrationTest |
| 27 | 27 | assert_routing('/myprofile/ze/cms', :profile => 'ze', :controller => 'cms', :action => 'index') |
| 28 | 28 | end |
| 29 | 29 | |
| 30 | + def test_cms_when_identifier_has_a_dot | |
| 31 | + assert_routing('/myprofile/ynternet.org/cms', :profile => 'ynternet.org', :controller => 'cms', :action => 'index') | |
| 32 | + end | |
| 33 | + | |
| 30 | 34 | def test_edit_template |
| 31 | 35 | # FIXME: this is wrong |
| 32 | 36 | assert_routing('/admin/edit_template', :controller => 'edit_template', :action => 'index') |
| ... | ... | @@ -36,6 +40,10 @@ class RoutingTest < ActionController::IntegrationTest |
| 36 | 40 | assert_routing('/myprofile/ze', :profile => 'ze', :controller => 'profile_editor', :action => 'index') |
| 37 | 41 | end |
| 38 | 42 | |
| 43 | + def test_profile_editor_when_identifier_has_a_dot | |
| 44 | + assert_routing('/myprofile/ynternet.org', :profile => 'ynternet.org', :controller => 'profile_editor', :action => 'index') | |
| 45 | + end | |
| 46 | + | |
| 39 | 47 | # environment administrative controllers (admin/*) |
| 40 | 48 | ################################################################ |
| 41 | 49 | ... | ... |