Error checking controller controller on resource resource_url (inherited_resources)

I use inherited_resources, and I have a controller, for example:

class Admin::PostsController < InheritedResources::Base
end

And in my control 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 get this error:

undefined method `posts_url' for #<Admin::PostsController:0xec6fb20>

The strange part is that this only happens in tests! The application is working fine.

What am I missing?

[EDIT] I found this question but was closed unanswered https://github.com/josevalim/inherited_resources/issues/193

[EDIT] I just found out why this is happening and answered the above problem page

+5
source share
1 answer

tried this:

response.should redirect_to '/your_url'

This may solve your problem.

+1
source

All Articles