diff options
author | Rick Olson <technoweenie@gmail.com> | 2006-12-07 16:31:41 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2006-12-07 16:31:41 +0000 |
commit | 90179a9ba5622075d150b4decfe9716e0424d380 (patch) | |
tree | ab5e995b407ff28464ecccdc869eb7e77d7d8405 /actionpack/test | |
parent | c49cd7f18afb7fdc116290416d744c152018bb6d (diff) | |
download | rails-90179a9ba5622075d150b4decfe9716e0424d380.tar.gz rails-90179a9ba5622075d150b4decfe9716e0424d380.tar.bz2 rails-90179a9ba5622075d150b4decfe9716e0424d380.zip |
added tests checking for nested singleton resources
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5703 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/resources_test.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb index c4fabc5f52..ea3f4288f2 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -235,6 +235,32 @@ class ResourcesTest < Test::Unit::TestCase end end + def test_should_nest_resources_in_singleton_resource + with_routing do |set| + set.draw do |map| + map.resource :account do |account| + account.resources :messages + end + end + + assert_singleton_restful_for :account + assert_simply_restful_for :messages, :path_prefix => 'account/' + end + end + + def test_should_nest_singleton_resource_in_resources + with_routing do |set| + set.draw do |map| + map.resources :threads do |thread| + thread.resource :admin + end + end + + assert_simply_restful_for :threads + assert_singleton_restful_for :admin, :path_prefix => 'threads/5/', :options => { :thread_id => '5' } + end + end + protected def with_restful_routing(*args) with_routing do |set| |