rating/spec/support/database_cleaner.rb

20 lines
342 B
Ruby
Raw Normal View History

2017-10-30 01:44:23 +00:00
# frozen_string_literal: true
require 'database_cleaner'
RSpec.configure do |config|
config.before :suite do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with :truncation
end
config.before { DatabaseCleaner.start }
config.around do |spec|
DatabaseCleaner.cleaning do
spec.run
end
end
end