Skip to content

Instantly share code, notes, and snippets.

@zealinux
Forked from timonv/spec_helper.rb
Created November 17, 2013 14:26
Show Gist options
  • Save zealinux/7513997 to your computer and use it in GitHub Desktop.
Save zealinux/7513997 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment