Flowdock
method

assert_recognizes

Importance_2
v1.2.0 - Show latest stable - 1 note - Class: ActionController::Assertions::RoutingAssertions
assert_recognizes(expected_options, path, extras={}, message=nil) public

Asserts that the routing of the given path was handled correctly and that the parsed options match.

  assert_recognizes({:controller => 'items', :action => 'index'}, 'items')

Pass a hash in the second argument to specify the request method. This is useful for routes requiring a specific method.

  assert_recognizes({:controller => 'items', :action => 'create'}, {:path => 'items', :method => :post})
Show source
Register or log in to add new notes.
August 16, 2009
1 thank

Small notice about recognize urls with specific HTTP verbs

This is wrong ruby syntax:

assert_recognizes {:controller => 'items', :action => 'create'}, {:path => 'items', :method => :post}

Parentheses are obligatory in this case:

assert_recognizes({:controller => 'items', :action => 'create'}, {:path => 'items', :method => :post})