➜ testrspec git:(master) rake routes
Prefix Verb URI Pattern Controller#Action
robots GET /robots(.:format) robots#index
POST /robots(.:format) robots#create
new_robot GET /robots/new(.:format) robots#new
edit_robot GET /robots/:id/edit(.:format) robots#edit
robot GET /robots/:id(.:format) robots#show
PATCH /robots/:id(.:format) robots#update
PUT /robots/:id(.:format) robots#update
DELETE /robots/:id(.:format) robots#destroy
1) RobotsController GET #show assigns the requested robot as @robot
Failure/Error: get :show, params: {id: robot.to_param}
ActionController::UrlGenerationError:
No route matches {:action=>"show", :controller=>"robots", :params=>{:id=>"1"}}
# ./spec/controllers/robots_controller_spec.rb:52:in `block (3 levels) in <top (required)>'
source
It turns out that the test should read
Note that the
getline has hadparams: {id: user.to_param}changed to justid: user.to_param. Was this changed at some point and the scaffold files not updated?