Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test more realistic scenario for 3rd-party engine
With factory_bot 5 we changed the official way to include factory_bot definitions in an engine from using an initializer to using the `config.factory_bot.definition_file_paths` configuration. We left these tests with the initializer around because we wanted to avoid breaking existing engines. With #331 if none of the paths in `config.factory_bot.definition_file_paths` exist we won't load any factory definitions at all. Before this PR this test was failing with #311 because none of the paths in `config.factory_bot.definition_file_paths` existed, and so the definition file in the engine never got loaded. I am changing this test because there scenario is unlike. If somebody is using factory_bot definitions from an engine, they will most likely have their own factory definitions as well, defined in one of the `config.factory_bot.definition_file_paths`. If it turns out somebody is using factory_bot definitions from an engine without also using definitions in their own project, there are a couple of workarounds: - Add an empty factory file (e.g. test/factories.rb) - Manually call `FactoryBot.reload` - Update the engine to use the official `config.factory_bot.definition_file_paths` instead of an initializer
- Loading branch information