Fixes for Rails 7.1 that can be extracted into default branch
What
- Fix spec/models/project_authorization_spec.rb
- Destroy a persisted model in tests to trigger after-commit
- Verify location for redirect url instead of body
- Redefine not_enqueue_email matcher
- Render pagination only if needed
- Do not fetch from cache if user is nil
- Use Arel::Table#name instead of Arel::Table#table_name
- Rename db:test:load -> db:test:load_schema
- Remove redundant ::Gitlab::Routing.url_helpers inclusion
Why
These changes fix the tests in Draft: Upgrade Rails to 7.1.1 version (!124004 - closed); however, they can be extracted to make the diff of the MR smaller.
The commits can be squashed on merge.
Edited by Igor Drozdov