Fix RSpec/LetSetup
cop in models/account_status_cleanup_policy
#28470
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I had opened this - #28361 - which was a mix of cop fixing and factory creation reduction.
This PR is JUST the cop-fixing portions of that, which also fix the final exclusion for this rule in the todo. In this case, they were both data setup and were moved to before blocks.
Assuming we're good with this, I'll rebase the other one and we can look at just the factory reduction portions.
Separately -- I know that fabrication gem has something similar to factory_bot traits (I think you do inheritance in fabrication?) which would allow us to make factories which come with associations created when that's desired, instead of needing to make them in before setup like done here. That might be a nice improvement to look at, separate from this ... if there's more than handful of these setups for a given fabrication, it would be a good change.