Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 5703

Show
Ignore:
Timestamp:
12/07/06 16:31:41 (2 years ago)
Author:
rick
Message:

added tests checking for nested singleton resources

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/test/controller/resources_test.rb

    r5701 r5703  
    236236  end 
    237237 
     238  def test_should_nest_resources_in_singleton_resource 
     239    with_routing do |set| 
     240      set.draw do |map| 
     241        map.resource :account do |account| 
     242          account.resources :messages 
     243        end 
     244      end 
     245       
     246      assert_singleton_restful_for :account 
     247      assert_simply_restful_for :messages, :path_prefix => 'account/' 
     248    end 
     249  end 
     250   
     251  def test_should_nest_singleton_resource_in_resources 
     252    with_routing do |set| 
     253      set.draw do |map| 
     254        map.resources :threads do |thread| 
     255          thread.resource :admin 
     256        end 
     257      end 
     258       
     259      assert_simply_restful_for :threads 
     260      assert_singleton_restful_for :admin, :path_prefix => 'threads/5/', :options => { :thread_id => '5' } 
     261    end 
     262  end 
     263 
    238264  protected 
    239265    def with_restful_routing(*args)