Tag Archives: Reset

Rails test database not resetting correctly

I have no idea why, but so far I’ve had this problem twice. My specs suddenly start failing for no apparent reason. When digging deeper, it seems my test database is not reset before starting the tests. Therefor quite a few validations fail because of unique constraints. The following code cleans the test database up.

rake db:test:prepare