Allow routes with a trailing slash to be recognized

Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#2039 state:committed]
This commit is contained in:
Mike Gunderloy 2009-03-03 17:40:39 -06:00 committed by Michael Koziarski
parent 9b1b88f09c
commit ce56c5daa8
2 changed files with 11 additions and 3 deletions

@ -318,7 +318,7 @@ def interpolation_chunk
end
def regexp_chunk
'(\.[^/?\.]+)?'
'/|(\.[^/?\.]+)?'
end
def to_s

@ -750,9 +750,17 @@ def test_nested_resources_in_nested_namespace
end
def test_with_path_segment
with_restful_routing :messages, :as => 'reviews' do
assert_simply_restful_for :messages, :as => 'reviews'
with_restful_routing :messages do
assert_simply_restful_for :messages
assert_recognizes({:controller => "messages", :action => "index"}, "/messages")
assert_recognizes({:controller => "messages", :action => "index"}, "/messages/")
end
with_restful_routing :messages, :as => 'reviews' do
assert_simply_restful_for :messages, :as => 'reviews'
assert_recognizes({:controller => "messages", :action => "index"}, "/reviews")
assert_recognizes({:controller => "messages", :action => "index"}, "/reviews/")
end
end
def test_multiple_with_path_segment_and_controller