Skip to content

Files

Latest commit

 

History

History
33 lines (21 loc) · 489 Bytes

FactoryBot-AttributeDefinedStatically.md

File metadata and controls

33 lines (21 loc) · 489 Bytes

Pattern: Attribute defined statically

Issue: -

Description

Always declare attribute values as blocks.

Examples

# bad
kind [:active, :rejected].sample

# good
kind { [:active, :rejected].sample }

# bad
closed_at 1.day.from_now

# good
closed_at { 1.day.from_now }

# bad
count 1

# good
count { 1 }

Further Reading