Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 583 Bytes

FactoryBot-CreateList.md

File metadata and controls

37 lines (24 loc) · 583 Bytes

Pattern: Malformed use of create_list

Issue: -

Description

Checks for create_list usage.

This rule can be configured using the EnforcedStyle option.

Examples

EnforcedStyle: create_list

# bad
3.times { create :user }

# good
create_list :user, 3

# good
3.times { |n| create :user, created_at: n.months.ago }

EnforcedStyle: n_times

# bad
create_list :user, 3

# good
3.times { create :user }

Further Reading