with_routing

with_routing()
Instance Public methods

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

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
  assert_equal "/users", users_path
end
doc_ruby_on_rails
2015-06-20 00:00:00
Comments
Leave a Comment

Please login to continue.