How to change environments in the console

 Make sure the test database is up to date:

rake db:reset RAILS_ENV=test
rake spec:db:fixtures:load RAILS_ENV=test #rails 2.x rake db:fixtures:load RAILS_ENV=test #rails 3.x

Work with the test data in the console:

script/console test #rails 2.x
rails c test #rails 3.x