Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
bbe00038
Commit
bbe00038
authored
Jan 22, 2018
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work around a bug in DatabaseCleaner when using the deletion strategy on MySQL
parent
93ea3234
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
spec/support/db_cleaner.rb
spec/support/db_cleaner.rb
+15
-0
No files found.
spec/support/db_cleaner.rb
View file @
bbe00038
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment