Created
November 30, 2015 17:22
-
-
Save jeffcole/8b6d2f7c67aa6d09ce73 to your computer and use it in GitHub Desktop.
ActiveRecord Spec Helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # From Rails 4 Test Prescriptions | |
| require 'spec_helper' | |
| require 'active_record' | |
| require 'yaml' | |
| ActiveRecord::Base.establish_connection( | |
| YAML.load_file("config/database.yml")["test"] | |
| ) | |
| RSpec.configure do |config| | |
| config.around do |example| | |
| ActiveRecord::Base.transaction do | |
| example.run | |
| raise ActiveRecord::Rollback | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment