[rspec-users] mocking/stubbing newbie questions

Scott Taylor mailing_lists at railsnewbie.com
Tue Mar 27 15:24:03 EDT 2007


What a dumb move.  I need to sleep more.

Thanks for your help.

Scott



On Mar 27, 2007, at 10:01 AM, Tim Lucas wrote:

> On 27/03/2007, at 11:55 PM, Scott Taylor wrote:
>
>>       it "should find all terms associated with the user" do
>>      User.should_receive(:find).with("1")
>>    end
>> end
>
> ...
>
>> Spec::Mocks::MockExpectationError in 'GET /users/1/terms should find
>> all terms associated with the user'
>> User expected :find with ("1") once, but received it 0 times
>> ./spec/controllers/terms_controller_spec.rb:43:
>
> you forgot to actually call your do_get method:
>
> it "should find all terms associated with the user" do
>    User.should_receive(:find).with("1")
>    do_get
> end
>
> -- tim
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



More information about the rspec-users mailing list