You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a factory bot definition, it would be nice to force some consistent structure:
alphabetical attribute ordering. Note that we should recognise FactoryBot methods (transient, association, trait, etc.)
possibly alphabetical trait ordering
General grouping, similar to class structure - e.g. transients in the beginning, followed by associations, followed by attributes, followed by traits and factories
Those could be separate cops of course
The text was updated successfully, but these errors were encountered:
Darhazer
changed the title
Cop idea: forceordering in factories
Cop idea: force ordering in factories
Sep 23, 2022
Speaking more broadly, and you know what I'm talking about by codename Ferrari, factories are the hottest pain point of testing. It's a shame there's no such thing as a factory_bot-style-guide. cc @AlexVKO.
I'm always triggered with bad memories when seeing dreaded factories with multiple after(:create) { create(:assoc, ...) }.
ydah
transferred this issue from rubocop/rubocop-rspec
May 6, 2023
Given a factory bot definition, it would be nice to force some consistent structure:
Those could be separate cops of course
The text was updated successfully, but these errors were encountered: