On 7/24/07, Rick Tessner <[EMAIL PROTECTED]> wrote:
> Hi,
>
> 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>
specing helpers just includes the module in your spec.
So you can cheat like
describe "Application Helper" do
helper_name :application
def controller
@controller
end
before(:each) do
@controller = mock('controller')
end
it "should blah blah" do
end
end
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users