1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00
kaminari--kaminari/spec/support/database_cleaner.rb

17 lines
527 B
Ruby
Raw Normal View History

DatabaseCleaner[:active_record].strategy = :transaction if defined? ActiveRecord
DatabaseCleaner[:data_mapper].strategy = :transaction if defined? DataMapper
DatabaseCleaner[:mongoid].strategy = :truncation if defined? Mongoid
DatabaseCleaner[:mongo_mapper].strategy = :truncation if defined? MongoMapper
RSpec.configure do |config|
config.before :suite do
2013-08-10 00:57:36 -04:00
DatabaseCleaner.clean_with :transaction
end
config.before :each do
DatabaseCleaner.start
end
config.after :each do
DatabaseCleaner.clean
end
end