Skip to content

Commit 3e6b7ca

Browse files
forkatanvandoorn
andcommitted
Allow loading of factories from namespaced extensions
The previous glob did not allow there to be more than one level of namespacing in the extension file structure. This change will support extensions that have their factories in folder like `lib/super_good/solidus_taxjar/testing_support/factories/*`. Co-authored-by: Nick Van Doorn <nick@super.gd>
1 parent a30e98a commit 3e6b7ca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/solidus_dev_support/testing_support/factories.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module TestingSupport
88
module Factories
99
def self.load_for(*engines)
1010
paths = engines.flat_map do |engine|
11-
engine.root.glob('lib/*/testing_support/factories{,.rb}')
11+
engine.root.glob('lib/**/testing_support/factories{,.rb}')
1212
end.map { |path| path.sub(/.rb\z/, '').to_s }
1313

1414
FactoryBot.definition_file_paths = [

0 commit comments

Comments
 (0)