Skip to content

Instantly share code, notes, and snippets.

@aquajach
Created August 29, 2013 03:50
Show Gist options
  • Save aquajach/6374068 to your computer and use it in GitHub Desktop.
Save aquajach/6374068 to your computer and use it in GitHub Desktop.
Way to speed up running rspec + capybara with 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment