1865
1865: Nottingham Forest Football Club in the Coca Cola Championship
 

Testing in Rails

Go to $RAILS_APP_ROOT/test/test_helper.rb and add the following line:

ActiveRecord::Base.connection.update('SET FOREIGN_KEY_CHECKS = 0')

This switches off foreign key constraints (on MySQL anyway) meaning that your tests can load and reload fixtures to their heart’s content, without getting hung up on the order of inserts and deletes.

Discuss this on Facebook

(by Rahoul eighteensixtyfive, 25 October, 2005)