Skip to content

Instantly share code, notes, and snippets.

@jaymiejones86
Created May 9, 2014 05:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaymiejones86/90f1580b27c5dbe5c3c0 to your computer and use it in GitHub Desktop.
Save jaymiejones86/90f1580b27c5dbe5c3c0 to your computer and use it in GitHub Desktop.
Database Cleaner Config
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = Capybara.current_driver == :rack_test ? :transaction : :truncation
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment