Skip to content

Instantly share code, notes, and snippets.

@rafaellima
Created May 5, 2014 22:52
Show Gist options
  • Save rafaellima/35c95a6e9ae9c5e8d058 to your computer and use it in GitHub Desktop.
Save rafaellima/35c95a6e9ae9c5e8d058 to your computer and use it in GitHub Desktop.
require 'active_record'
connection_info = YAML.load_file("config/database.yml")["test"]
ActiveRecord::Base.establish_connection(connection_info)
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