Closed jaydorsey closed 2 months ago
Some how, ended up on this repo instead of the rubocop-factory_bot one. Feel free to delete
This is fine, we’ve just recently extracted factory_bot-related cops, and the two gems are tightly bound until the next major release.
I ran the corrector w/ this cop on our codebase, using the
explicit
style. It made one correction which broke factorybot.I wrote a test that reproduced the behavior below but I wasn't quite sure what direction the PR should go in (fixing the auto corrector, or the rule)
The problem is a nested factory that looks like
factory :active_article, traits: [:approved, :active]
and:association :factory, :active_article, traits: [:active, :approved]
which breaks rubocopThe interesting thing is if I just add a
do;end
block to my:active_article
factory, it ignores the error. I have a draft PR I'm going to push up shortly.