On Fri, Aug 1, 2008 at 10:41 AM, Bastien <[EMAIL PROTECTED]> wrote: > 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" > end > > 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 > #Survey.should_receive(:find) > get :show, :survey_id=>"34", :controller =>"surveys/report" > end >
Actually, that's a sign that you're *not* hitting the desired #show method. Survey.find("34") will fail with RecordNotFound unless you have a survey with id=34 in your test db (unlikely). > Any other idea ? Maybe you have a filter in your controller that prevents show from being called? I'd resort to some good old puts debugging.. BTW, I just committed some specs based on your code, and they pass: http://github.com/dchelimsky/rspec-dev/commit/9a7ce9ce371b1136380e97e34d33397966734b0f Aslak > _______________________________________________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users