From 3e6b7ca6ba9f5c1952558e08d03b546b039ae4bd Mon Sep 17 00:00:00 2001 From: Chris Todorov Date: Wed, 10 May 2023 15:29:12 -0700 Subject: [PATCH] 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 --- lib/solidus_dev_support/testing_support/factories.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/solidus_dev_support/testing_support/factories.rb b/lib/solidus_dev_support/testing_support/factories.rb index d226168e..fa27bdaf 100644 --- a/lib/solidus_dev_support/testing_support/factories.rb +++ b/lib/solidus_dev_support/testing_support/factories.rb @@ -8,7 +8,7 @@ module TestingSupport module Factories def self.load_for(*engines) paths = engines.flat_map do |engine| - engine.root.glob('lib/*/testing_support/factories{,.rb}') + engine.root.glob('lib/**/testing_support/factories{,.rb}') end.map { |path| path.sub(/.rb\z/, '').to_s } FactoryBot.definition_file_paths = [