[rspec-users] Can I set an expectation that a method invokes super?
matt-lists at reprocessed.org
Sat Jan 30 04:50:33 EST 2010
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
> 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.
Matt Patterson | Design & Code
<matt at reprocessed org> | http://www.reprocessed.org/
More information about the rspec-users