# setup db
rake db:schema:dump # make schema.rb from exist database
rake db:create RAILS_ENV=test
rake db:migrate RAILS_ENV=test
rake db:test:load # Recreate the test database from the current schema.rb
3.1.1 Rake Tasks for Preparing your Application for Testing
Tasks Description
rake db:test:clone Recreate the test database from the current environment’s database schema
rake db:test:clone_structure Recreate the test databases from the development structure
rake db:test:load Recreate the test database from the current schema.rb
rake db:test:prepare Check for pending migrations and load the test schema
rake db:test:purge Empty the test database.