Routing rspec with nested routes


You would like to add a routing rspec test in your rails application that tests for a nested route.
So while you have something like the following in your config/routes.rb file:

you want to add the following test for your route:

but you are getting an error like the following:


You will need to change your rspec to the following using any number for the user_id:

Solution adapted from here