| | 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 | |
|---|