URL Helper - undefined method
rake routes:
api_v1_accounts GET /api/v1/accounts(.:format) {:action=>"index", :controller=>"api/v1/accounts"}
That means I should have a url helper method:
api_v1_accounts_url
I am trying to test creating an account with rspec and the following line fails:
route = api_v1_accounts_url(account)
Saying t开发者_JS百科hat api_v1_accounts_url
is an undefined method
I guess I've really misunderstood something about URL helper methods and the scope of them. Please help
include Rails.application.routes.url_helpers
That did the trick
精彩评论