Test custom Rails routes with RSpec
Recently I was reading how to test custom rails routes, so I would like to share it.
Image that we have the current custom route:
and we want to test that the request is routable.
Our test will be:
Notice that we convert the id to string, otherwise the test is going to fail. The route_to matcher is very helpful when we want to test routes other than
standard RESTful routes.
For more examples you can check the Relish documentation for RSpec route_to matcher.