[rspec-users] Verifying some understanding about manipulating DB data in before/after callbacks in RSpec

Mark Wilden mark at mwilden.com
Thu Nov 6 17:19:01 EST 2008


On Thu, Nov 6, 2008 at 1:32 PM, Wes Gamble <weyus at att.net> wrote:

> We had an after(:each) callback that looked like this:
>
>  PurchaseOrder.find(:all).each {|po|
> DraftInvoice.find_all_by_po_number(po.po_number).each {|di| di.destroy}}
>
> which we were hoping would reset some purchase order data in a certain way.
>

If you're running 'rake spec' then your test database will be completely
empty at the end, except for fixture data.

///ark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081106/0fa12702/attachment.html>


More information about the rspec-users mailing list