Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
config.use_transactional_fixtures = false
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
# Force the driver to wait till the page finishes loading
config.after(:each, js: true) do
current_path.should == current_path
end
config.after(:each) do
DatabaseCleaner.clean
end
@rmontgomery429

This comment has been minimized.

Copy link

rmontgomery429 commented Apr 14, 2014

BTW, @jnicklas also suggests using an :around block for database cleaning. teamcapybara/capybara#1089 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.