Logo: Relish

  1. Sign in

Project: RSpec Rails 2.13

Routing specs

Routing specs live in the spec/routing directory, or any example group with
:type => :routing.

Simple apps with nothing but standard RESTful routes won't get much value from
routing specs, but they can provide significant value when used to specify
customized routes, like vanity links, slugs, etc.

expect(:get => "/articles/2012/11/when-to-use-routing-specs").to route_to(
  :controller => "articles",
  :month => "2012-11",
  :slug => "when-to-use-routing-specs"
)

They are also valuable for routes that should not be available:

expect(:delete => "/accounts/37").not_to be_routable

Topics

  1. be_routable matcher
  2. engine routes
  3. named routes
  4. route_to matcher

Last published about 4 years ago by alindeman.