Skip to content

Latest commit

 

History

History
44 lines (29 loc) · 955 Bytes

RSpec-FactoryBot-CreateList.md

File metadata and controls

44 lines (29 loc) · 955 Bytes

Pattern: Malformed use of create_list

Issue: -

Description

Checks for create_list usage.

This cop 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 }

Configurable attributes

Name Default value Configurable values
EnforcedStyle create_list create_list, n_times

Further Reading