Re: [rspec-users] stub! does not work

2010-12-03 Thread David Chelimsky
On Dec 3, 2010, at 5:37 AM, Zhi-Qiang Lei wrote: > Hi, > > This piece of code does not work. Does anybody know the cause? > > > describe "/loan-events/{source-id}-lend.json" do >describe "GET" do > it "should call all method of LoanEvent with source_id" do >source_id = rand(10

[rspec-users] stub! does not work

2010-12-03 Thread Zhi-Qiang Lei
Hi, This piece of code does not work. Does anybody know the cause? describe "/loan-events/{source-id}-lend.json" do describe "GET" do it "should call all method of LoanEvent with source_id" do source_id = rand(1000) LoanEvent.should_receive(:all).with(:source_id => so