Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8836

Show
Ignore:
Timestamp:
02/10/08 01:09:07 (6 months ago)
Author:
nzkoz
Message:

2-0-stable: Make assert_routing aware of the HTTP method used. References #8039 [mpalmer]

Merging [8748]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2-0-stable/actionpack/lib/action_controller/assertions/routing_assertions.rb

    r8300 r8836  
    115115      #  # Tests a route, providing a defaults hash 
    116116      #  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" }) 
    117120      def assert_routing(path, options, defaults={}, extras={}, message=nil) 
    118121        assert_recognizes(options, path, extras, message) 
     
    123126        end 
    124127          
    125         assert_generates(path, options, defaults, extras, message) 
     128        assert_generates(path.is_a?(Hash) ? path[:path] : path, options, defaults, extras, message) 
    126129      end 
    127130 
  • branches/2-0-stable/actionpack/test/controller/test_test.rb

    r8783 r8836  
    402402  end 
    403403 
     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 
    404411  def test_assert_routing_in_module 
    405412    assert_routing 'admin/user', :controller => 'admin/user', :action => 'index' 
  • branches/2-0-stable/activerecord/CHANGELOG

    r8828 r8836  
    11*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 
    26 
    37* Ensure that modifying has_and_belongs_to_many actions clear the query cache.  Closes #10840 [john.andrews]