Skip to content

Instantly share code, notes, and snippets.

@jsteiner
Created January 10, 2014 20:31
Show Gist options
  • Star 80 You must be signed in to star a gist
  • Fork 16 You must be signed in to fork a gist
  • Save jsteiner/8362013 to your computer and use it in GitHub Desktop.
Save jsteiner/8362013 to your computer and use it in GitHub Desktop.
Database Cleaner
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
@thelastinuit
Copy link

@gregblass @ptrikutam nvm... 🤦‍♂️ it was a stupid mistake... sorry to bother you guys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment