diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-11-14 12:27:08 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-11-14 12:27:08 +0100 |
commit | c562dfc2a7981351e2f9302c76456fae32da91b2 (patch) | |
tree | 27f90b5b0c0dbae697bcf9f74763f662f4e79a9f /actionpack/test/controller/resources_test.rb | |
parent | 61e43700b85de753b6254893d5365e04d3465b9a (diff) | |
parent | 2ecec6052f7f290252a9fd9cc27ec804c7aad36c (diff) | |
download | rails-c562dfc2a7981351e2f9302c76456fae32da91b2.tar.gz rails-c562dfc2a7981351e2f9302c76456fae32da91b2.tar.bz2 rails-c562dfc2a7981351e2f9302c76456fae32da91b2.zip |
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'actionpack/test/controller/resources_test.rb')
-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 1f1f7b8a2c..04f7a0a528 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -971,6 +971,32 @@ class ResourcesTest < Test::Unit::TestCase end end + def test_nested_resource_ignores_only_option + with_routing do |set| + set.draw do |map| + map.resources :products, :only => :show do |product| + product.resources :images, :except => :destroy + end + end + + assert_resource_allowed_routes('images', { :product_id => '1' }, { :id => '2' }, [:index, :new, :create, :show, :edit, :update], :destroy, 'products/1/images') + assert_resource_allowed_routes('images', { :product_id => '1', :format => 'xml' }, { :id => '2' }, [:index, :new, :create, :show, :edit, :update], :destroy, 'products/1/images') + end + end + + def test_nested_resource_ignores_except_option + with_routing do |set| + set.draw do |map| + map.resources :products, :except => :show do |product| + product.resources :images, :only => :destroy + end + end + + assert_resource_allowed_routes('images', { :product_id => '1' }, { :id => '2' }, :destroy, [:index, :new, :create, :show, :edit, :update], 'products/1/images') + assert_resource_allowed_routes('images', { :product_id => '1', :format => 'xml' }, { :id => '2' }, :destroy, [:index, :new, :create, :show, :edit, :update], 'products/1/images') + end + end + protected def with_restful_routing(*args) with_routing do |set| |