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

Ticket #8039: assert_routing_with_path_as_hash.diff

File assert_routing_with_path_as_hash.diff, 1.1 kB (added by packagethief, 2 years ago)
  • actionpack/test/controller/test_test.rb

    old new  
    321321    assert_routing 'content', :controller => 'content', :action => 'index' 
    322322  end 
    323323 
     324  def test_assert_routing_with_path_as_hash 
     325    assert_routing({:path => 'content', :method => :get}, :controller => 'content', :action => 'index') 
     326  end 
     327 
    324328  def test_assert_routing_in_module 
    325329    assert_routing 'admin/user', :controller => 'admin/user', :action => 'index' 
    326330  end 
  • actionpack/lib/action_controller/assertions/routing_assertions.rb

    old new  
    7878          options[:controller] = "/#{controller}" 
    7979        end 
    8080          
     81        path = path[:path] if path.is_a? Hash 
    8182        assert_generates(path, options, defaults, extras, message) 
    8283      end 
    8384