Class: RuboCop::Cop::RSpec::FactoryBot::AttributeDefinedStatically

Inherits:
Base
  • Object
show all
Defined in:
lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb

Overview

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 }