trabajo-afectivo/spec/support/db_strategies.rb

20 lines
464 B
Ruby
Raw Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
RSpec.configure do |config|
config.around(:each, db_strategy: :reset) do |example|
if MysqlStrategy.db?
self.use_transactional_tests = false
end
example.run
if MysqlStrategy.db?
MysqlStrategy.reset
else
Models.all.each_key do |model|
model.connection.schema_cache.clear!
model.reset_column_information
end
end
end
end