Looking at yr earlier post ...

controller.stub!(:entries).and_return(@entry)

Not sure why you are stubbing entries on the controller ... entries is  
called on the current user ...

I tend to do this ...

@current_user = mock_model(User, :id => 1, :entries => [EMAIL PROTECTED])

HTH
Shane

On 13/04/2008, at 7:24 AM, newbie wrote:

> 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
> end
>
> describe "on the main page" do
> it "should show all the current entries for the user" do
>    get :index
>    assigns[:entries].should == @entries
> end
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users


_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to