Skip to content

Instantly share code, notes, and snippets.

@joemsak
Created November 1, 2011 19:29
Show Gist options
  • Save joemsak/1331643 to your computer and use it in GitHub Desktop.
Save joemsak/1331643 to your computer and use it in GitHub Desktop.
SpecHelper's Database Cleaner strategy
RSpec.configure do |config|
#...
config.use_transactional_fixtures = false
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