Skip to content

Instantly share code, notes, and snippets.

@nvanselow
Created July 13, 2016 18:29
Show Gist options
  • Save nvanselow/4cce96d4b72e84c381b29d951c321e5c to your computer and use it in GitHub Desktop.
Save nvanselow/4cce96d4b72e84c381b29d951c321e5c to your computer and use it in GitHub Desktop.
Database cleaner config for capybara-webki
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, js: true) do
DatabaseCleaner.strategy = :truncation
end
config.before(:each) do
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