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

newbie alen198 at gmail.com
Sat Apr 12 15:24:22 EDT 2008

Hey Jarkko,

Thanks for the feedback. I tried your suggestion and it doesn't seem
to work.

To quickly recap I'm just testing in my controller that this works

def index
@entries = current_user.entries

describe "on the main page" do
 it "should show all the current entries for the user" do
    get :index
    assigns[:entries].should == @entries

More information about the rspec-users mailing list