factory_bot icon indicating copy to clipboard operation
factory_bot copied to clipboard

Fix docs about definition file paths

Open r7kamura opened this issue 1 year ago • 0 comments

The current implementation seems to load all definition files that match the following pattern in this order:

  1. factories.rb
  2. factories/**/*.rb
  3. test/factories.rb
  4. test/factories/**/*.rb
  5. spec/factories.rb
  6. spec/factories/**/*.rb

https://github.com/thoughtbot/factory_bot/blob/053ef4af1a7fd845bb8f5f9ae65967249c247617/lib/factory_bot/find_definitions.rb#L10-L24

There are several documents that mention definition file paths, but none of them are consistent with the current implementation. So I propose to first eliminate the gap between the documentation and the implementation in this pull request.

I would also be interested to know if this implementation is intentional or not, as it is important to know which files should be ideally scanned by rubocop-factory_bot.

r7kamura avatar Feb 20 '24 07:02 r7kamura