From f00650b1dbc86f861e44efacd15060bcbc15897d Mon Sep 17 00:00:00 2001 From: JoenioCosta Date: Sat, 7 Jun 2008 15:55:40 +0000 Subject: [PATCH] ActionItem403: fixing error on tags with dot --- config/routes.rb | 5 +++-- test/integration/routing_test.rb | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index c8e77ea..ff0df27 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -28,7 +28,8 @@ ActionController::Routing::Routes.draw do |map| # tags map.tag 'tag', :controller => 'search', :action => 'tags' - map.tag 'tag/:tag', :controller => 'search', :action => 'tag' + map.tag 'tag/:tag', :controller => 'search', :action => 'tag', :tag => /.*/ + # categories index map.category 'cat/*category_path', :controller => 'search', :action => 'category_index' map.assets 'assets/:asset/*category_path', :controller => 'search', :action => 'assets' @@ -38,7 +39,7 @@ ActionController::Routing::Routes.draw do |map| # public profile information - map.profile 'profile/:profile/:action/:id', :controller => 'profile', :action => 'index' + map.profile 'profile/:profile/:action/:id', :controller => 'profile', :action => 'index', :id => /.*/ ###################################################### ## Controllers that are profile-specific (for profile admins ) diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index 613c4fb..1869ede 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -85,10 +85,18 @@ class RoutingTest < ActionController::IntegrationTest assert_routing('/tag/umboraminhaporra', :controller => 'search', :action => 'tag', :tag => 'umboraminhaporra') end + def test_view_tag_with_dot + assert_routing('/tag/tag.withdot', :controller => 'search', :action => 'tag', :tag => 'tag.withdot') + end + def test_profile_routing assert_routing('/profile/ze', :controller => 'profile', :profile => 'ze', :action => 'index') assert_routing('/profile/ze/friends', :controller => 'profile', :profile => 'ze', :action => 'friends') end + + def test_profile_route_for_tags_with_dot + assert_routing('/profile/ze/tag/tag.withdot', :controller => 'profile', :profile => 'ze', :action => 'tag', :id => 'tag.withdot') + end def test_search_routing assert_routing('/search', :controller => 'search', :action => 'index', :category_path => []) -- libgit2 0.21.2