Sha256: 37ec603d18e620b2e0ac9dbf1ad597a523f4bdafc9aa17d1b53199b0573a5e45
Contents?: true
Size: 740 Bytes
Versions: 2
Compression:
Stored size: 740 Bytes
Contents
require "database_cleaner" RSpec.configure do |config| config.before(:suite) do unless WITHOUT_ACTIVE_RECORD require "database_cleaner-active_record" DatabaseCleaner[:active_record].strategy = :truncation end # Since models are defined dynamically in specs, Database Cleaner is unable # to list them and to determine collection names to be cleaned. # Therefore, they are specified explicitly here. unless WITHOUT_MONGOID require "database_cleaner-mongoid" DatabaseCleaner[:mongoid].strategy = :truncation, { only: "users" } end DatabaseCleaner.clean_with(:truncation) end config.around(:each) do |example| DatabaseCleaner.cleaning do example.run end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
attr_masker-0.3.1 | spec/support/db_cleaner.rb |
attr_masker-0.3.0 | spec/support/db_cleaner.rb |