From 064e5b0e9908f2f9e5ad6e6d8637a1d03adb0c52 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Tue, 10 Jun 2008 02:00:21 +0000 Subject: [PATCH] ActionItem392: support more chars in profiles --- config/routes.rb | 2 +- test/integration/routing_test.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index ff0df27..c9932b2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -76,6 +76,6 @@ ActionController::Routing::Routes.draw do |map| # *content viewing* # XXX this route must come last so other routes have priority over it. - map.homepage ':profile/*page', :controller => 'content_viewer', :action => 'view_page' + map.homepage ':profile/*page', :controller => 'content_viewer', :action => 'view_page', :profile => /[a-z][a-z0-9._-]*/ end diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index cd3cf1a..19e0091 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -122,4 +122,8 @@ class RoutingTest < ActionController::IntegrationTest assert_routing('/ze-withdash', :controller => 'content_viewer', :action => 'view_page', :profile => 'ze-withdash', :page => []) end + def test_content_view_with_underscore + assert_routing('/ze_with_underscore', :controller => 'content_viewer', :action => 'view_page', :profile => 'ze_with_underscore', :page => []) + end + end -- libgit2 0.21.2