My Bad... Please ignore
On 7/10/07, Daniel N <[EMAIL PROTECTED]> wrote:
Hi,
I'm trying to setup a mock for my controller test but I can't get it to
recognise the mock.
I use
it "should find all users" do
User.should_receive(:find).with( :all, :limit => 10
).and_return([EMAIL PROTECTED])
do_get
end
and in the controller
@users = User.find(:all, :limit => 10 )
But this does not work. It gives me
User expected :find with (:all) once, but received it 0 times
If I remove the :limit from the controller
@users = User.find(:all)
I get
User expected :find with (:all, {:limit=>10}) once, but received it 0
times
How do I spec mocks with options passed to them?
Cheers
Daniel
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users