public
Rubygem
Description: Rails RESTful controller abstraction plugin.
Homepage: http://jamesgolick.com/resource_controller
Clone URL: git://github.com/giraffesoft/resource_controller.git
Click here to lend your support to: resource_controller and make a donation at www.pledgie.com !
Add a test for a generated custom action
giraffesoft (author)
Wed May 07 19:14:33 -0700 2008
commit  a17e99a8b0087776a24dbc3bd5a6c2d53daab9a9
tree    b7ea4d4a1c28eada1292a45f34f74a0b057e9b5b
parent  0a8903d9de26da9158882486b9735251ae6e8de4
...
25
26
27
28
 
29
30
31
...
25
26
27
 
28
29
30
31
0
@@ -25,7 +25,7 @@ ActionController::Routing::Routes.draw do |map|
0
     post.resources :comments, :name_prefix => "post_"
0
   end
0
   
0
- map.resources :comments
0
+ map.resources :comments, :member => {:custom_action => :post}
0
 
0
   # The priority is based upon order of creation: first created -> highest priority.
0
   
...
23
24
25
 
 
 
 
 
 
 
 
 
26
...
23
24
25
26
27
28
29
30
31
32
33
34
35
0
@@ -23,4 +23,13 @@ class CommentsControllerTest < Test::Unit::TestCase
0
   should_be_restful do |resource|
0
     resource.formats = [:html]
0
   end
0
+
0
+ context "on post to custom_action" do
0
+ setup do
0
+ post :custom_action, :id => @comment
0
+ end
0
+
0
+ should_render_template 'custom_action'
0
+ should_assign_to :comment
0
+ end
0
 end

Comments

    No one has commented yet.