Reputation: 19939
I have a location resource and access via:
http://localhost:3000/locations/37/edit
In my spec, I have:
it "should allows us to edit" do
@u=User.find_by_email('[email protected]')
session[:user_id][email protected]
get edit_location_path, {:id => '37'}
but get the following error:
Failures:
1) LocationsController should allows us to edit
Failure/Error: get edit_location_path, :id => '37'
ActionController::RoutingError:
No route matches {:action=>"edit", :controller=>"locations"}
# ./spec/controllers/locations_controller_spec.rb:12:in `block (2 levels) in <top (required)>'
How would I specify the link to this resource?
thx
Upvotes: 0
Views: 679
Reputation: 226
Assuming it's a controller spec describing LocationsController
, you can access it with get :edit, :id => 37
.
Upvotes: 2