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

Add #traits_for_enum to RuboCop::RSpec::FactoryBot.reserved_methods #943

Closed
harrylewis opened this issue Jun 25, 2020 · 1 comment · Fixed by #944
Closed

Add #traits_for_enum to RuboCop::RSpec::FactoryBot.reserved_methods #943

harrylewis opened this issue Jun 25, 2020 · 1 comment · Fixed by #944
Assignees
Labels

Comments

@harrylewis
Copy link
Contributor

Thank you for building and maintaining rubocop-rspec. My team uses this and a lot of the defaults are pretty sensible, and help us to write cleaner tests!

FactoryBot recently released version 6.0.0, which introduces a new method to use within a factory definition, #traits_for_enum. Using this causes Rubocop to flag it with FactoryBot/AttributeDefinedStatically. This issue stems from the fact that this new method is not included in Rubocop::RSpec::FactoryBot.reserved_methods.

https://github.com/rubocop-hq/rubocop-rspec/blob/fad338729759334cb7411802e54cdf84f0e685c4/lib/rubocop/rspec/factory_bot.rb#L37-L40

A simple fix would be to include this reserved method in the list. I don't mind creating a PR for this.

Curious to hear your thoughts!

@pirj
Copy link
Member

pirj commented Jun 26, 2020

Hey! Thanks for bringing this up.
Sure, a pull request is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants