[rspec-users] Database.truncate_all

Matt Wynne matt at mattwynne.net
Sun Dec 7 14:07:17 EST 2008

On 7 Dec 2008, at 17:56, Tero Tilus wrote:

> 2008-12-05 08:32, Jeff Talbot:
>> I want to clear out the database after every run so my tests are
>> isolated.
> Maybe a minor detail, but I'd suggest you clear out the db _before_
> each run.

I respectfully disagree :)

If I need this done, I can run rake db:test:prepare

I think the tests should clean up after themselves.

As you can see from the thread Ben linked to, it's pretty easy to  
watch what ActiveRecord is doing, and truncate all the tables that  
have been touched during a scenario.

Matt Wynne

More information about the rspec-users mailing list