Installazione DatabaseCleaner
require 'plugins/database-cleaner'# frozen_string_literal: true
require 'database_cleaner/active_record'
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.start
end
config.around do |example|
DatabaseCleaner.cleaning do
example.run
end
end
endLast updated