Based on my understanding of the rspec spec, I would expect the following example to pass.
describe ApplicationController do
controller do
def test
end
end
it "calls actions" do
get :test
end
end
Instead it fails with:
No route matches {:controller=>"anonymous", :action=>"test"}
I’ve even tried defining the route for the “anonymous” controller in the routes file but to no avail. Is there something I’m missing here? This should work, shouldn’t it?
I was having a similar problem. In my case the solution was including an :id parameter in the get request in the test.
I.e.
Check your routes and see if you are missing a certain parameter (probably :id), then add that to the test.