Skip to content

Instantly share code, notes, and snippets.

@JonRowe

JonRowe/db_spec_helper.rb

Last active Aug 29, 2015
Embed
What would you like to do?
Delay the slow things!
# An example used to segregate DB loading to those specs requiring it only.
RSpec.configure do |config|
config.include DBHelper::DB, db: true
config.include DSL::Setup, db: true
config.before(:all, db: true) do
DBHelper.load!
end
config.before(:each, db: true) do
DatabaseCleaner.start
end
config.after(:each, db: true) do
DatabaseCleaner.clean
end
end
RSpec.configure do |c|
c.before :all, :integration do
require 'slow_things'
end
c.include SlowHelpers, :integration
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment