Fix order dependent cleanup package file worker spec
What does this MR do and why?
This MR fixes an order dependent spec. It also fixes some RuboCop TODOs
See #359097 (closed)
To quote: https://docs.gitlab.com/ee/development/testing_guide/best_practices.html#common-test-setup
As much as possible, do not implement this using before(:all) or before(:context). If you do, you would need to manually clean up the data as those hooks run outside a database transaction.
Screenshots or screen recordings
n/a
How to set up and validate locally
while :; do bin/rspec --order rand ./spec/workers/packages/cleanup_package_file_worker_spec.rb || break; done
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Peter Leitzen