diff --git a/config/routes.rb b/config/routes.rb index dfb391c..7bb5363 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -56,8 +56,8 @@ ActionController::Routing::Routes.draw do |map| ## Controllers that are profile-specific (for profile admins ) ###################################################### # profile customization - "My profile" - map.myprofile 'myprofile/:profile', :controller => 'profile_editor', :action => 'index' - map.myprofile 'myprofile/:profile/:controller/:action/:id', :controller => Noosfero.pattern_for_controllers_in_directory('my_profile') + map.myprofile 'myprofile/:profile', :controller => 'profile_editor', :action => 'index', :profile => /#{Noosfero.identifier_format}/ + map.myprofile 'myprofile/:profile/:controller/:action/:id', :controller => Noosfero.pattern_for_controllers_in_directory('my_profile'), :profile => /#{Noosfero.identifier_format}/ ###################################################### diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index d8435e5..32e8e7e 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -27,6 +27,10 @@ class RoutingTest < ActionController::IntegrationTest assert_routing('/myprofile/ze/cms', :profile => 'ze', :controller => 'cms', :action => 'index') end + def test_cms_when_identifier_has_a_dot + assert_routing('/myprofile/ynternet.org/cms', :profile => 'ynternet.org', :controller => 'cms', :action => 'index') + end + def test_edit_template # FIXME: this is wrong assert_routing('/admin/edit_template', :controller => 'edit_template', :action => 'index') @@ -36,6 +40,10 @@ class RoutingTest < ActionController::IntegrationTest assert_routing('/myprofile/ze', :profile => 'ze', :controller => 'profile_editor', :action => 'index') end + def test_profile_editor_when_identifier_has_a_dot + assert_routing('/myprofile/ynternet.org', :profile => 'ynternet.org', :controller => 'profile_editor', :action => 'index') + end + # environment administrative controllers (admin/*) ################################################################ -- libgit2 0.21.2