Skip to content

Instantly share code, notes, and snippets.

@adamstrickland
Created May 6, 2020 17:25
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 adamstrickland/e658da998ed545544867c8ca91d78bb1 to your computer and use it in GitHub Desktop.
Save adamstrickland/e658da998ed545544867c8ca91d78bb1 to your computer and use it in GitHub Desktop.
config.use_transactional_fixtures = false
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
config.before(:all) do
DatabaseCleaner.start
end
config.after(:all) do
DatabaseCleaner.clean
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment