Multiple Test Environments in Rails
Multiple test enviorments allow for developers with different DB settings, gem desires to be able to setup and run the same test suite independently of one another.
Create the file
config/enviroments/jordan_test.rd and copy into it the contents of
Via command line from application root:
cp config/environments/test.rb config/environments/jordan_test.rb
in config/database.yml add your DB settings (assumes using Postgres)
1 2 3 4 5 6 7
Create the new database
add environment to any :test specific gems or gem groups in your gem file
1 2 3
or make a bundler group in application.rb so others envs can be added easier.
1 2 3 4 5 6
Usual run rake
db:test:clone instead possible to run
rake db:migrate RAILS_ENV=jordan_test perhaps make an alias for this in your .bash_profile