Permalink
Browse files

Added test case for overwritting the name prefix

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6593 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
dhh committed Apr 27, 2007
1 parent 8bf1f25 commit f985bfd8f8854a3d27da39237ce410d12955595a
Showing with 20 additions and 0 deletions.
  1. +20 −0 actionpack/test/controller/resources_test.rb
@@ -214,6 +214,26 @@ def test_nested_restful_routes
end
end
+ def test_nested_restful_routes_with_overwritten_defaults
+ with_routing do |set|
+ set.draw do |map|
+ map.resources :threads do |map|
+ map.resources :messages, :name_prefix => nil do |map|
+ map.resources :comments, :name_prefix => nil
+ end
+ end
+ end
+
+ assert_simply_restful_for :threads
+ assert_simply_restful_for :messages,
+ :path_prefix => 'threads/1/',
+ :options => { :thread_id => '1' }
+ assert_simply_restful_for :comments,
+ :path_prefix => 'threads/1/messages/2/',
+ :options => { :thread_id => '1', :message_id => '2' }
+ end
+ end
+
def test_restful_routes_dont_generate_duplicates
with_restful_routing :messages do
routes = ActionController::Routing::Routes.routes

0 comments on commit f985bfd

Please sign in to comment.