[rspec-users] spec'ing helpers that use controller

Rick Tessner rick.tessner at gmail.com
Tue Jul 24 18:37:21 EDT 2007


On Tue, 2007-24-07 at 15:26 -0700, Courtenay wrote:
> Does this work?
>   ApplicationHelper.stub!(:controller).and_return mock('controller',
> :controller_name => 'foo')

Sadly, no.  Same result:

        undefined local variable or method `controller' for [RSpec
        example]: #<Class:0xb7149760>

rick.tessner at gmail.com

More information about the rspec-users mailing list