Flowdock
method

with_routing

Importance_1
v1.1.1 - Show latest stable - 0 notes - Class: ActionController::TestProcess
with_routing() public

A helper to make it easier to test different route configurations. This method temporarily replaces ActionController::Routing::Routes with a new RouteSet instance.

The new instance is yielded to the passed block. Typically the block will create some routes using map.draw { map.connect … }:

  with_routing do |set|
    set.draw { set.connect ':controller/:id/:action' }
    assert_equal(
       ['/content/10/show', {}],
       set.generate(:controller => 'content', :id => 10, :action => 'show')
    )
  end
Show source
Register or log in to add new notes.