From cdb1b8b6109a65b392c4960d45e4eaa1078cbac7 Mon Sep 17 00:00:00 2001 From: Damien Mathieu <42@dmathieu.com> Date: Tue, 20 Apr 2010 09:00:52 +0200 Subject: [PATCH] test routing excepted resource but defined as named --- actionpack/test/dispatch/routing_test.rb | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 5bca476..1f0ab09 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -201,6 +201,9 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end match "whatever/:controller(/:action(/:id))" + + match "cat/:id", :to => 'categories#show' + resources :categories, :only => :index end end @@ -654,6 +657,18 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_raise(ActionController::RoutingError) { delete '/posts/1/comments' } end end + + def test_resource_excepted_but_defined_as_named + with_test_routes do + get '/categories' + assert_equal 'categories#index', @response.body + + get '/cat/test' + assert_equal 'categories#show', @response.body + + assert_raise(ActionController::RoutingError) { get '/categories/test' } + end + end def test_resource_with_slugs_in_ids with_test_routes do -- 1.6.6.rc4