On Fri, Jul 27, 2012 at 3:50 PM, Ari <[email protected]> wrote: > I'm trying to stub an authentication filter in my controller specs with the > following "before" block. > > before(:all) do > controller.stub(:signed_in?).and_return(true)
`controller` is configured before each individual example, so you need to use before(:each) > end > > Unfortunately, I'm getting: > > Failure/Error: controller.stub(:signed_in?).and_return(true) > NoMethodError: undefined method `stub' for nil:NilClass > > Does anyone know how to resolve this error? I'm using rails 3.2.6 with > rspec-rails 2.10.1 > > Thanks. > > -Ari -- You received this message because you are subscribed to the Google Groups "rspec" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
