Sha256: 2656f944f3d73bfb85cd2f0df7719a5b41ef9bdae286f931414c0e9fef6f407d
Contents?: true
Size: 1.12 KB
Versions: 12
Compression:
Stored size: 1.12 KB
Contents
############################################################################## # Database Cleaner Plugin ############################################################################## begin require 'database_cleaner' begin autodetected = DatabaseCleaner::Base.new.__send__(:autodetect) rescue DatabaseCleaner::NoORMDetected autodetected = false end if autodetected 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 if defined? RSpec::Rails RSpec.configure do |config| config.use_transactional_fixtures = false end end end rescue LoadError if defined? RSpec::Rails RSpec.configure do |config| config.use_transactional_fixtures = true end end end
Version data entries
12 entries across 12 versions & 1 rubygems