If you haven't been using TDD with Rails, you've probably wondered what the test database in database.yml is. This is the configuration for the test database. Now that you're going to be using tests, you must configure it correctly.
The first thing to note is that it should not point to your production or development databases. The test database is created and destroyed often when running tests. If this points to a database already in use, it will be wiped out. Be sure you configure your test database to be its own database!
Using the default SQLite database configuration, the test portion of your database.yml should look something like this. This is also taken from the default database.yml, so if you've just generated your Rails project, this should already be created for you.
test: adapter: sqlite3 database: db/test.sqlite3 pool: 5 timeout: 5000