Test Database Empty after "rake test"?

Hey,

can somebody tell me why my test database is always empty after I run
“rake test” but not after I test single test files? My rake db:seed for
the test database takes like 6 minutes and I don’t really wanna reseed
it every time I run “rake test”. Is it possible to not let “rake test”
truncate my database?

I googled and went through the test files. There’s no hint or
anything… no one?

Heinz S. wrote:

Hey,

can somebody tell me why my test database is always empty after I run
“rake test” but not after I test single test files? My rake db:seed for
the test database takes like 6 minutes and I don’t really wanna reseed
it every time I run “rake test”. Is it possible to not let “rake test”
truncate my database?

This question comes up on the list from time to time. I’ll give the
same answer I always give: that’s a really, really bad (and dangerous)
idea. The point is that each test starts from a known state. You
shouldn’t need your whole seed data to run your tests – just use
factories to create what you need for each test.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Yeah, you’re right. Might switch to Factories instead. Don’t really need
500 NPC when I can test all the stuff having 5-10 :slight_smile:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs