Created
October 8, 2015 15:07
-
-
Save workmad3/068303504358de3494b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'database_cleaner' | |
RSpec.configure do |config| | |
config.use_transactional_fixtures = false | |
DatabaseCleaner.logger = Rails.logger | |
config.before(:all) do | |
DatabaseCleaner.clean_with(:truncation) | |
end | |
config.before do | |
DatabaseCleaner.strategy = :transaction | |
end | |
config.before(js: true) do | |
DatabaseCleaner.strategy = :truncation | |
end | |
config.before(type: :smoke) do | |
DatabaseCleaner.strategy = :truncation | |
end | |
config.before do | |
DatabaseCleaner.start | |
end | |
config.after do | |
begin | |
DatabaseCleaner.clean | |
rescue | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment