method

with_routing

Importance_1
v8.0.0 - Show latest stable - 0 notes - Class: ClassMethods
with_routing(&block) public

A helper to make it easier to test different route configurations. This method temporarily replaces @routes with a new RouteSet instance before each test.

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

with_routing do |set|
  set.draw do
    resources :users
  end
end
Show source
Register or log in to add new notes.