On Sep 6, 2010, at 8:37 PM, Zhenning Guan wrote: > David Chelimsky wrote: >> I'm having a hard time understanding what you're trying to do here. Can >> you please post the full before and after code and spec listing in a >> gist or pastie? >> >> http://gist.github.com >> http://pastie.org > > the before just mock a user. and user request to withdraw money from > he's bank account, after that, we record his action like 'david withdraw > $10' in bankbook. > the problem above is I expect one bankbook 'david withdraw $10' but > create two 'david withdraw $10'.in database, just because the I use last > api to receive last record. > @ning.bankbooks.last.action.should == 'withdraw' > > I guess I should do a count check like > > lambda{ withdrawal.process!}.should change {Bankbook.count}.by(1)
By "before and after" I meant what the code looked like before you made the change you want to make, and what it looked like after the change. _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users