[rspec-users] mock out render call in helper

Chris Hoffman bosshoff at gmail.com
Fri Apr 13 08:05:17 EDT 2007

Okay, so if I use

@controller.render :foo

instead of just

render :foo

in the helper, I can mock it out fine in the specs with


Am I wrong to use the shortened "render :foo" form in the helpers, or
is this a malfunction of RSpec?

On 4/13/07, Chris Hoffman <bosshoff at gmail.com> wrote:
> Hello,
>   Does someone know where I can hook in to mock out a render call from
> a helper in Rails?  I know I can do this in view specs with the
> following
> @controller.template.stub!(:render)
> but template doesn't seem to be attached to @controller in a helper
> context.  Thanks.
> -Chris

More information about the rspec-users mailing list