Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cop idea: mutually exclusive FactoryBot traits #14

Open
pirj opened this issue Jul 1, 2020 · 0 comments
Open

Cop idea: mutually exclusive FactoryBot traits #14

pirj opened this issue Jul 1, 2020 · 0 comments
Labels

Comments

@pirj
Copy link
Member

pirj commented Jul 1, 2020

FactoryBot.define do
  factory :user
  trait :active do
    status { 'active' }
  do
  trait :inactive do
    status 'inactive'
  do
end

This allows for an undefined behaviour when being called as create(:user, :active, :inactive).
We should recommend making them sub-factories, not traits.

@ydah ydah transferred this issue from rubocop/rubocop-rspec May 6, 2023
@ydah ydah added the cop label May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants