Truncate the DB in after(:all) test for Gitlab::ImportExport::ProjectTreeRestorer
What does this MR do?
The users created in the before(:all)
by the importer were not cleared from the DB. This was leading to some other tests that rely on User.all
size to fail down the road, as seen in https://gitlab.com/gitlab-org/gitlab-ee/builds/10681852. By using DatabaseCleaner.clean_with(:truncation)
we ensure we clean our mess after the tests are run.
Are there points in the code the reviewer needs to double check?
We could add the following to spec/support/db_cleaner.rb
?
config.append_after(:all) do
DatabaseCleaner.clean_with(:truncation)
end