Skip to content

Instantly share code, notes, and snippets.

@orlando
Forked from coreyhaines/.rspec
Last active December 20, 2015 10:39
Show Gist options
  • Save orlando/6117338 to your computer and use it in GitHub Desktop.
Save orlando/6117338 to your computer and use it in GitHub Desktop.
require 'active_record'
require 'database_cleaner'
connection_info = YAML.load_file("config/database.yml")["test"]
ActiveRecord::Base.establish_connection(connection_info)
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
end
require 'fast_spec_helper'
describe "FastSpecs" do
it "should be fast" do
end
end
require 'active_record_spec_helper'
require 'pry'
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__),'../'))
$: << File.join(APP_ROOT, "app/models")
$: << File.join(APP_ROOT, "lib")
$: << File.join(APP_ROOT, "spec/fixtures")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment