Skip to content

Instantly share code, notes, and snippets.

@Haar
Created October 2, 2013 20:09
Show Gist options
  • Save Haar/6799766 to your computer and use it in GitHub Desktop.
Save Haar/6799766 to your computer and use it in GitHub Desktop.
WIP AR Spec Helper
require 'active_record'
connection_info = YAML.load_file("config/database.yml")["test"]
ActiveRecord::Base.establish_connection(connection_info) unless ActiveRecord::Base.connected?
factory_girl_loaded = FactoryGirl.factories.find(:account) rescue false
require 'shoulda/matchers/integrations/rspec'
require 'factory_girl_rails'
FactoryGirl.find_definitions unless factory_girl_loaded
$:.push File.expand_path("../../app/models", __FILE__)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment