Commit bbe00038 authored by Nick Thomas's avatar Nick Thomas

Work around a bug in DatabaseCleaner when using the deletion strategy on MySQL

parent 93ea3234
require 'database_cleaner/active_record/deletion'
module FakeInformationSchema
# Work around a bug in DatabaseCleaner when using the deletion strategy:
# https://github.com/DatabaseCleaner/database_cleaner/issues/347
#
# On MySQL, if the information schema is said to exist, we use an inaccurate
# row count leading to some tables not being cleaned when they should
def information_schema_exists?(_connection)
false
end
end
DatabaseCleaner::ActiveRecord::Deletion.prepend(FakeInformationSchema)
RSpec.configure do |config| RSpec.configure do |config|
# Ensure all sequences are reset at the start of the suite run # Ensure all sequences are reset at the start of the suite run
config.before(:suite) do config.before(:suite) do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment