[rspec-users] Can't access actions of a singular nested resource

Bastien bastien.vaucher at gmail.com
Fri Aug 1 04:41:08 EDT 2008

Thanks for your help Aslak, but I still didn't manage to make it pass

>> get :show, :id=>"34"

it sends me this error then : No route matches
{:action=>"show", :controller=>"surveys/report", :id=>"34"}

>> Try rake routes, and also try to spec the routing in the associated
>> routing_spec.rb.

and this test passes :

 it "should map { :controller => 'report', :action =>
'show', :survey_id => 1} to /survey/1/report" do
      route_for(:controller => "surveys/report", :action =>
"show", :survey_id => 1).should == "/surveys/1/report"

also if I try to remove my condition the test passes so the routes
must be correct
it "should return the survey corresponding to the report" do
    get :show, :survey_id=>"34", :controller =>"surveys/report"

Any other idea ?

More information about the rspec-users mailing list