[rspec-users] should_redirect_to in advance - feels unnatural

Bryan Helmkamp bhelmkamp at gmail.com
Wed Nov 8 02:53:06 EST 2006


On 11/7/06, David Chelimsky <dchelimsky at gmail.com> wrote:
> On 11/7/06, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:
> > # Or better, since it doesn't do the extra action:
> > session[:user] = User.new
>
> I like that a LOT better, because a failure in the login process won't
> cause this spec to fail. Better isolation.

On one of my projects, I do this in the setup method a lot:

@controller.expects(:logged_in?).returns(true)

That's a one liner that made me love mocks.

-Bryan

-- 
http://www.MyCongress.org/ -- coming soon


More information about the rspec-users mailing list