In this recipe, we'll see how to properly test drive and verify routes in a Rails application. Routes determine which controller handles a particular request based on the data provided by the client's browser.
To spec controller routes, we'll first need an actual controller. Without it, Rails won't properly route requests and we won't be able to validate our specs:
$ rails g controller locations --no-helper
As a part of controller generation, if the
--no-helper option wasn't passed, an empty helper and spec file with pending examples would be created.