Test environment¶
Installation¶
- Add a test database in your database.yml configuration file :
test: adapter: sqlite3 database: db/test.sqlite3 pool: 5 timeout: 5000
- Create your database with :
~foreman$ RAILS_ENV=test rake db:migrate
- Run the all tests :
~foreman$ RAILS_ENV=test rake test
- Or a singe test :
~foreman/test$ RAILS_ENV=test ruby functional/your_test.rb
Troubleshooting¶
- If you have some errors like that :
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- rr (MissingSourceFile)
juste install missing gem. In that case :gem install rr
