提交 ce56c5da 编写于 作者: M Mike Gunderloy 提交者: Michael Koziarski

Allow routes with a trailing slash to be recognized

Signed-off-by: NMichael Koziarski <michael@koziarski.com>
[#2039 state:committed]
上级 9b1b88f0
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册