Closed kennyadsl closed 3 years ago
It looks like this PR is missing a label to determine the type of change it introduces. The maintainer should add one of the following labels:
bug
for bugfixes.enhancement
for new features and improvements.documentation
for documentation changes.security
for security patches.removed
for feature removals.infrastructure
for internal changes that should not go in the changelog.Additionally, the maintainer may also want to add one of the following:
breaking
for breaking changes.deprecated
for feature deprecations.Once the correct labels have been set, simply remove the needs changelog label
label from this PR so I can merge it.
Yes, I know this could be confusing. It means that in the spec_helper
of your host application you may have switched to the new FactoryBot automatic loading using FactoryBot.definition_file_paths
. Right now we can't use that API directory to load extensions factory, unless we do something like:
FactoryBot.definition_file_paths = [
Spree::TestingSupport::FactoryBot.definition_file_paths,
SolidusSubscriptions::Engine.root.glob('lib/solidus_subscriptions/testing_support/factories/**/*_factory.rb').map { |path| path.sub(/.rb\z/, '') },
Rails.root.join('spec/factories')
].flatten
So, we can take advantage of this method added into solidus_dev_support
, which also loads core factories:
SolidusDevSupport::TestingSupport::Factories.load_for(SolidusSubscription::Engine, SolidusContent::Engine)
This is an intermediate step, I'd like the final API in a host application to be:
FactoryBot.definition_file_paths = [
Spree::TestingSupport::FactoryBot.definition_file_paths,
SolidusSubscriptions::FactoryBot.definition_file_paths,
SoldiusContent::FactoryBot.definition_file_paths,
Rails.root.join('spec/factories')
].flatten
To load factories of extensions.