2012-05-20 10:27:30 -04:00
|
|
|
DatabaseCleaner[:active_record].strategy = :transaction if defined? ActiveRecord
|
2013-11-04 20:33:06 -05:00
|
|
|
DatabaseCleaner[:data_mapper].strategy = :truncation if defined? DataMapper
|
2012-05-20 10:27:30 -04:00
|
|
|
DatabaseCleaner[:mongoid].strategy = :truncation if defined? Mongoid
|
|
|
|
DatabaseCleaner[:mongo_mapper].strategy = :truncation if defined? MongoMapper
|
2011-04-02 01:27:28 -04:00
|
|
|
|
|
|
|
RSpec.configure do |config|
|
|
|
|
config.before :suite do
|
2013-08-10 23:44:44 -04:00
|
|
|
DatabaseCleaner.clean_with :truncation if defined? ActiveRecord
|
2013-11-04 20:33:06 -05:00
|
|
|
DatabaseCleaner.clean_with :truncation if defined? DataMapper
|
2013-08-10 23:44:44 -04:00
|
|
|
DatabaseCleaner.clean_with :truncation if defined? Mongoid
|
|
|
|
DatabaseCleaner.clean_with :truncation if defined? MongoMapper
|
2011-04-02 01:27:28 -04:00
|
|
|
end
|
|
|
|
config.before :each do
|
|
|
|
DatabaseCleaner.start
|
|
|
|
end
|
|
|
|
config.after :each do
|
|
|
|
DatabaseCleaner.clean
|
|
|
|
end
|
|
|
|
end
|