public
Fork of NZKoz/koz-rails
Description: Koz's rails git-svn clone
Homepage: http://www.rubyonrails.org
Clone URL: git://github.com/eventualbuddha/koz-rails.git
2-0-stable: Make assert_routing aware of the HTTP method used.  References 
#8039 [mpalmer]

Merging [8748]


git-svn-id: 
http://svn-commit.rubyonrails.org/rails/branches/2-0-stable@8836 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
nzkoz (author)
Sat Feb 09 17:09:07 -0800 2008
commit  4d48286caa45218be05ae426f7f480774125e357
tree    b111042557edaaf643db6f4a0ccaa3ba56d5fb15
parent  cf5127bad501367bb45e47e35d31b45864e4f4ae
...
114
115
116
 
 
 
117
118
119
...
122
123
124
125
 
126
127
128
...
140
141
142
143
144
 
...
114
115
116
117
118
119
120
121
122
...
125
126
127
 
128
129
130
131
...
143
144
145
 
146
147
0
@@ -114,6 +114,9 @@ module ActionController
0
       #
0
       # # Tests a route, providing a defaults hash
0
       # assert_routing 'controller/action/9', {:id => "9", :item => "square"}, {:controller => "controller", :action => "action"}, {}, {:item => "square"}
0
+ #
0
+ # # Tests a route with a HTTP method
0
+ # assert_routing({ :method => 'put', :path => '/product/321' }, { :controller => "product", :action => "update", :id => "321" })
0
       def assert_routing(path, options, defaults={}, extras={}, message=nil)
0
         assert_recognizes(options, path, extras, message)
0
         
0
@@ -122,7 +125,7 @@ module ActionController
0
           options[:controller] = "/#{controller}"
0
         end
0
          
0
- assert_generates(path, options, defaults, extras, message)
0
+ assert_generates(path.is_a?(Hash) ? path[:path] : path, options, defaults, extras, message)
0
       end
0
 
0
       private
0
@@ -140,4 +143,4 @@ module ActionController
0
         end
0
     end
0
   end
0
-end
0
\ No newline at end of file
0
+end
...
401
402
403
 
 
 
 
 
 
 
404
405
406
...
401
402
403
404
405
406
407
408
409
410
411
412
413
0
@@ -401,6 +401,13 @@ XML
0
     assert_routing 'content', :controller => 'content', :action => 'index'
0
   end
0
 
0
+ def test_assert_routing_with_method
0
+ with_routing do |set|
0
+ set.draw { |map| map.resources(:content) }
0
+ assert_routing({ :method => 'post', :path => 'content' }, { :controller => 'content', :action => 'create' })
0
+ end
0
+ end
0
+
0
   def test_assert_routing_in_module
0
     assert_routing 'admin/user', :controller => 'admin/user', :action => 'index'
0
   end
...
1
2
 
 
 
 
3
4
5
...
1
2
3
4
5
6
7
8
9
0
@@ -1,5 +1,9 @@
0
 *SVN*
0
 
0
+* Make assert_routing aware of the HTTP method used. #8039 [mpalmer]
0
+ e.g. assert_routing({ :method => 'put', :path => '/product/321' }, { :controller => "product", :action => "update", :id => "321" })
0
+
0
+
0
 * Ensure that modifying has_and_belongs_to_many actions clear the query cache. Closes #10840 [john.andrews]
0
 
0
 * Fix issue where Table#references doesn't pass a :null option to a *_type attribute for polymorphic associations. Closes #10753 [railsjitsu]

Comments

    No one has commented yet.