module ActionDispatch::Assertions::RoutingAssertions
def with_routing(config = nil, &block)
end
assert_equal "/users", users_path
end
resources :users
set.draw do
with_routing do |set|
create some routes using `set.draw { match ... }`:
The new instance is yielded to the passed block. Typically the block will
temporarily replaces @routes with a new RouteSet instance.
A helper to make it easier to test different route configurations. This method
def with_routing(config = nil, &block) old_routes, old_controller = @routes, @controller create_routes(config, &block) ensure reset_routes(old_routes, old_controller) end