Skip to content

Instantly share code, notes, and snippets.

@skinofstars
Created May 14, 2014 10:55
Show Gist options
  • Save skinofstars/3ecfbd2b472c0435f451 to your computer and use it in GitHub Desktop.
Save skinofstars/3ecfbd2b472c0435f451 to your computer and use it in GitHub Desktop.
consistent DatabaseCleaner strategy in rspec
RSpec.configure do |config|
config.before(:suite) 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