Open Darhazer opened 2 years ago
I'm on the fence regarding ordering, sometimes it's interleaved for better visibility:
role { :generic } # attribute
trait(:admin) do
role { :admin }
end
tweaked_at { Time.current }
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, ...) }
.
Given a factory bot definition, it would be nice to force some consistent structure:
Those could be separate cops of course