On 13.2.2008, at 21.09, Brad Carson <[EMAIL PROTECTED]> wrote:
> Pat Maddox wrote: >> Try >> >> Event.stub!(:find).and_raise(RecordNotFound) > > To my credit, I did try that (though ActiveRecord::RecordNotFound, of > course) but then I get: > > EventsController attempt to show non-existing event > - should render 404 (ERROR - 2) > - should not assign an event (ERROR - 3) > > ActiveRecord::RecordNotFound in 'EventsController attempt to show > non-existing event should render 404' > ActiveRecord::RecordNotFound > > Mind-boggling. The exception is never rescued. You'd have to catch the exception yourself, I think, and render the 404 page. I might be talking through my ass but I think the built in rescue of AR::RNF only works in production. //jarkko > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > 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