[rspec-users] how to stub the :current_user and any methods associated with it

Fernando Perez lists at ruby-forum.com
Wed Nov 5 09:05:26 EST 2008


I'm also having problems stubbing current_user.

I cannot put 
controller.stub!(:current_user).and_return(@current_user)
 in a before(:all) block. The stubbing doesn't happen.

However if I put it in the it "should..." block, then it works.

Why is that?
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list