Skip to content

Instantly share code, notes, and snippets.

@svlasov
Created March 8, 2013 23:53
Show Gist options
  • Save svlasov/5121432 to your computer and use it in GitHub Desktop.
Save svlasov/5121432 to your computer and use it in GitHub Desktop.
Setup database cleaner in Rails app
group :test do
gem 'rspec-rails'
gem 'shoulda-matchers'
gem 'capybara'
gem 'factory_girl_rails'
gem 'database_cleaner'
gem 'jasmine'
end
require 'database_cleaner'
#...
config.before(:suite) do
DatabaseCleaner.strategy = :truncation
DatabaseCleaner.orm = "activerecord"
end
config.before(:each) do
DatabaseCleaner.clean
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment