From ce56c5daa81d61a745b88220014a846a0eea46a4 Mon Sep 17 00:00:00 2001 From: Mike Gunderloy Date: Tue, 3 Mar 2009 17:40:39 -0600 Subject: Allow routes with a trailing slash to be recognized Signed-off-by: Michael Koziarski [#2039 state:committed] --- actionpack/test/controller/resources_test.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'actionpack/test/controller/resources_test.rb') diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb index ae2639d245..c441cfd4cf 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -750,9 +750,17 @@ class ResourcesTest < ActionController::TestCase 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 -- cgit v1.2.3