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

create rubocop that will check location of FactoryBot file for specific model #56

Open
Ivanov-Anton opened this issue Jun 27, 2023 · 0 comments
Labels
cop good first issue Good for newcomers

Comments

@Ivanov-Anton
Copy link

To improve the consistency of factory definitions, we can add a separate Rubocop rule, such as FactoryBot/LocationPath, that enforces creating FactoryBot files in the appropriate folder based on the namespace of the corresponding model.

For instance, if we have a model named "Main::Chat," in the case when the developer defines each factory as a separate file, the FactoryBot file should be located under the "spec/factories/main/" folder.

By implementing this Rubocop rule, we ensure that all factories are consistently organized and adhere to the correct naming conventions and directory structure.

@ydah ydah added cop good first issue Good for newcomers labels Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cop good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants