Commit 064e5b0e9908f2f9e5ad6e6d8637a1d03adb0c52
1 parent
143f026a
Exists in
master
and in
29 other branches
ActionItem392: support more chars in profiles
added routing for profile with dots, dashes and underscores git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1978 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
5 additions
and
1 deletions
Show diff stats
config/routes.rb
| ... | ... | @@ -76,6 +76,6 @@ ActionController::Routing::Routes.draw do |map| |
| 76 | 76 | |
| 77 | 77 | # *content viewing* |
| 78 | 78 | # XXX this route must come last so other routes have priority over it. |
| 79 | - map.homepage ':profile/*page', :controller => 'content_viewer', :action => 'view_page' | |
| 79 | + map.homepage ':profile/*page', :controller => 'content_viewer', :action => 'view_page', :profile => /[a-z][a-z0-9._-]*/ | |
| 80 | 80 | |
| 81 | 81 | end | ... | ... |
test/integration/routing_test.rb
| ... | ... | @@ -122,4 +122,8 @@ class RoutingTest < ActionController::IntegrationTest |
| 122 | 122 | assert_routing('/ze-withdash', :controller => 'content_viewer', :action => 'view_page', :profile => 'ze-withdash', :page => []) |
| 123 | 123 | end |
| 124 | 124 | |
| 125 | + def test_content_view_with_underscore | |
| 126 | + assert_routing('/ze_with_underscore', :controller => 'content_viewer', :action => 'view_page', :profile => 'ze_with_underscore', :page => []) | |
| 127 | + end | |
| 128 | + | |
| 125 | 129 | end | ... | ... |