I am using inherited_resources and I have a controller like:
class Admin::PostsController < InheritedResources::Base
end
And in my controller test:
it "redirects to the post" do
post = Post.create! valid_attributes
put :update, {:id => post.to_param, :post => valid_attributes}, valid_session
response.should redirect_to([:admin, post])
end
I am getting this error:
undefined method `posts_url' for #<Admin::PostsController:0xec6fb20>
The weird part is that it is only happening in the tests! The application runs ok.
What am I missing?
[EDIT] I found this issue reported, but was closed without an answer https://github.com/josevalim/inherited_resources/issues/193
[EDIT] I just found why it is happening and responded on the above issue page
have u tried this:
response.should redirect_to '/your_url'
it may be solved your problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With