Changeset 8836
- Timestamp:
- 02/10/08 01:09:07 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2-0-stable/actionpack/lib/action_controller/assertions/routing_assertions.rb
r8300 r8836 115 115 # # Tests a route, providing a defaults hash 116 116 # assert_routing 'controller/action/9', {:id => "9", :item => "square"}, {:controller => "controller", :action => "action"}, {}, {:item => "square"} 117 # 118 # # Tests a route with a HTTP method 119 # assert_routing({ :method => 'put', :path => '/product/321' }, { :controller => "product", :action => "update", :id => "321" }) 117 120 def assert_routing(path, options, defaults={}, extras={}, message=nil) 118 121 assert_recognizes(options, path, extras, message) … … 123 126 end 124 127 125 assert_generates(path , options, defaults, extras, message)128 assert_generates(path.is_a?(Hash) ? path[:path] : path, options, defaults, extras, message) 126 129 end 127 130 branches/2-0-stable/actionpack/test/controller/test_test.rb
r8783 r8836 402 402 end 403 403 404 def test_assert_routing_with_method 405 with_routing do |set| 406 set.draw { |map| map.resources(:content) } 407 assert_routing({ :method => 'post', :path => 'content' }, { :controller => 'content', :action => 'create' }) 408 end 409 end 410 404 411 def test_assert_routing_in_module 405 412 assert_routing 'admin/user', :controller => 'admin/user', :action => 'index' branches/2-0-stable/activerecord/CHANGELOG
r8828 r8836 1 1 *SVN* 2 3 * Make assert_routing aware of the HTTP method used. #8039 [mpalmer] 4 e.g. assert_routing({ :method => 'put', :path => '/product/321' }, { :controller => "product", :action => "update", :id => "321" }) 5 2 6 3 7 * Ensure that modifying has_and_belongs_to_many actions clear the query cache. Closes #10840 [john.andrews]