Skip to content

Instantly share code, notes, and snippets.

@danielmorrison
Created January 31, 2014 20:46
Show Gist options
  • Save danielmorrison/8742783 to your computer and use it in GitHub Desktop.
Save danielmorrison/8742783 to your computer and use it in GitHub Desktop.
put inside spec/spec_helper.rb inside the RSpec.configure block
config.before(:suite) do
DatabaseCleaner.strategy = :truncation
DatabaseCleaner.clean_with(:truncation)
end
config.around(:each) do |example|
DatabaseCleaner.start
example.run
DatabaseCleaner.clean
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment