aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/resources_test.rb
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-01-08 01:07:48 +0000
committerRick Olson <technoweenie@gmail.com>2007-01-08 01:07:48 +0000
commit0727af86fccb249f361901540d2977c2180be930 (patch)
treecef1102de64ea2dac50a64506dd0c4c2e98b6206 /actionpack/test/controller/resources_test.rb
parent31fb0deec16d1911a9c7892089e4d695f90a6425 (diff)
downloadrails-0727af86fccb249f361901540d2977c2180be930.tar.gz
rails-0727af86fccb249f361901540d2977c2180be930.tar.bz2
rails-0727af86fccb249f361901540d2977c2180be930.zip
Fix bug where nested resources ignore a parent singleton parent's path prefix. Closes #6940 [Dan Kubb]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5872 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/resources_test.rb')
-rw-r--r--actionpack/test/controller/resources_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb
index be0d6d1814..0ae9240598 100644
--- a/actionpack/test/controller/resources_test.rb
+++ b/actionpack/test/controller/resources_test.rb
@@ -247,6 +247,19 @@ class ResourcesTest < Test::Unit::TestCase
assert_simply_restful_for :messages, :path_prefix => 'account/'
end
end
+
+ def test_should_nest_resources_in_singleton_resource_with_path_prefix
+ with_routing do |set|
+ set.draw do |map|
+ map.resource(:account, :path_prefix => ':site_id') do |account|
+ account.resources :messages
+ end
+ end
+
+ assert_singleton_restful_for :account, :path_prefix => '7/', :options => { :site_id => '7' }
+ assert_simply_restful_for :messages, :path_prefix => '7/account/', :options => { :site_id => '7' }
+ end
+ end
def test_should_nest_singleton_resource_in_resources
with_routing do |set|