On 28 Jan 2010, at 17:49, Rick DeNatale wrote:

> Not sure if I can easily do this
> 
> Just ran into a bug in a rails app where ApplicationController
> overrides rescue_action_in_public leading to the error page not being
> displayed.
> 
> The fix was to call super at the end of the method.
> 
> I'd like to write a spec to ensure that this doesn't regress, but my
> imagination is failing me as to how to do it.

Two thoughts, one not very helpful, the other hopefully more so.

My approach with this area has been to ignore the mechanics of error catching 
in controllers, to steer clear of rescue_action_in_public in apps - using 
rescue_from instead - and using a custom matcher to check that particular 
controllers declare that they rescue particular errors. To ensure that, in 
practice, the right stuff happens I use Cucumber to check that in a 404 type 
situation the right stuff happens across the whole stack.

HTH

Matt


-- 
  Matt Patterson | Design & Code
  <matt at reprocessed org> | http://www.reprocessed.org/



_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to