Skip to content

Files

Latest commit

 

History

History
28 lines (19 loc) · 644 Bytes

RSpec-FactoryBot-FactoryClassName.md

File metadata and controls

28 lines (19 loc) · 644 Bytes

Pattern: Missing use of string value for class name

Issue: -

Description

Use string value when setting the class attribute explicitly.

This cop would promote faster tests by lazy-loading of application files. Also, this could help you suppress potential bugs in combination with external libraries by avoiding a preload of application files from the factory files.

Examples

# bad
factory :foo, class: Foo do
end

# good
factory :foo, class: 'Foo' do
end

Further Reading