Changeset 8748
- Timestamp:
- 01/30/08 01:25:44 (7 months ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/assertions/routing_assertions.rb (modified) (2 diffs)
- trunk/actionpack/test/controller/test_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r8738 r8748 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" }) 2 5 3 6 * Make map.root accept a single symbol as an argument to declare an alias. #10818 [bscofield] trunk/actionpack/lib/action_controller/assertions/routing_assertions.rb
r8300 r8748 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 trunk/actionpack/test/controller/test_test.rb
r8570 r8748 375 375 end 376 376 377 def test_assert_routing_with_method 378 with_routing do |set| 379 set.draw { |map| map.resources(:content) } 380 assert_routing({ :method => 'post', :path => 'content' }, { :controller => 'content', :action => 'create' }) 381 end 382 end 383 377 384 def test_assert_routing_in_module 378 385 assert_routing 'admin/user', :controller => 'admin/user', :action => 'index'