aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-04-27 05:10:23 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-04-27 05:10:23 +0000
commitf985bfd8f8854a3d27da39237ce410d12955595a (patch)
tree4388000ffb9052bed050ac72b0e2d4abddf7d185 /actionpack/test
parent8bf1f2525498c51b6bca7bdc6b19cb58c9303ba2 (diff)
downloadrails-f985bfd8f8854a3d27da39237ce410d12955595a.tar.gz
rails-f985bfd8f8854a3d27da39237ce410d12955595a.tar.bz2
rails-f985bfd8f8854a3d27da39237ce410d12955595a.zip
Added test case for overwritting the name prefix
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6593 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/resources_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb
index 8d5e68c420..337dd4abce 100644
--- a/actionpack/test/controller/resources_test.rb
+++ b/actionpack/test/controller/resources_test.rb
@@ -214,6 +214,26 @@ class ResourcesTest < Test::Unit::TestCase
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