aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/routing_test.rb
diff options
context:
space:
mode:
authorJan De Poorter <jan@defv.be>2010-02-25 16:21:41 +0100
committerwycats <wycats@gmail.com>2010-03-28 18:34:48 -0700
commit72074aac334a846fbb53e7cb12c0254c15004c26 (patch)
tree70841578599e08c00289112dc5671532a3d71a6f /actionpack/test/dispatch/routing_test.rb
parent4b07352420c4a3c0fdae40fd6fd31796f39a8909 (diff)
downloadrails-72074aac334a846fbb53e7cb12c0254c15004c26.tar.gz
rails-72074aac334a846fbb53e7cb12c0254c15004c26.tar.bz2
rails-72074aac334a846fbb53e7cb12c0254c15004c26.zip
Add _index to named collection routes for uncountable resources (e.g. Sheep)
Signed-off-by: Rizwan Reza <rizwanreza@gmail.com>
Diffstat (limited to 'actionpack/test/dispatch/routing_test.rb')
-rw-r--r--actionpack/test/dispatch/routing_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index b1de96cee5..4821b5986c 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -113,6 +113,8 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
resources :posts, :only => [:index, :show] do
resources :comments, :except => :destroy
end
+
+ resources :sheep
match 'sprockets.js' => ::TestRoutingMapper::SprocketsApp
@@ -530,6 +532,13 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
assert_raise(ActionController::RoutingError) { delete '/posts/1/comments' }
end
end
+
+ def test_resources_for_uncountable_names
+ with_test_routes do
+ assert_equal '/sheep', sheep_index_path
+ assert_equal '/sheep/1', sheep_path(1)
+ end
+ end
def test_path_names
with_test_routes do