module RSpec::Rails::Matchers::RoutingMatchers
def be_routable
{:post => "/another/path"}.should be_routable
{:get => "/a/path"}.should be_routable
You can use route helpers provided by rspec-rails.
@example
`RouteSet#recognize_path`.
the declarations in `config/routes.rb`. Delegates to
Passes if the route expression is recognized by the Rails router based on
def be_routable BeRoutableMatcher.new(self) end
def route_to(*expected)
- See: http://api.rubyonrails.org/classes/ActionDispatch/Assertions/RoutingAssertions.html#method-i-assert_recognizes -
def route_to(*expected) RouteToMatcher.new(self, *expected) end