我有一个位置资源并通过以下方式访问:
http://localhost:3000/locations/37/edit
在我的规范中,我有:
it "should allows us to edit" do
@u=User.find_by_email('jon@domain.com')
session[:user_id]=@u.id
get edit_location_path, {:id => '37'}
但得到以下错误:
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)>'
我将如何指定此资源的链接?
谢谢