views:

49

answers:

2

I have some fake data in the test database, but when I run rake spec the script drops and creates the whole database. How could I avoid that? or is it something I'm doing wrong?

EDIT: I just don't want to generate 1.000.000 records from the database every time. It took so long.

+1  A: 

What's the problem? Your test database should only be used by your tests, are you using it for something else?

I'm not sure why you're trying to populate a million records. You should take a look into FactoryGirl (http://github.com/thoughtbot/factory%5Fgirl). It's a great replacement to fixtures, and will let you setup your test database in a repeatable way.

jonnii
I just don't want to generate 1.000.000 records from the database every time. It took so long.
Hector Villalobos
+1  A: 

Why on earth do you need 1,000,000 records in the test database? Testing environments aren't for performance testing. You should only have as many records as you need to verify that a feature is functioning correctly.

Erik Peterson