Skip to content

Commit

Permalink
Fix factory bot integration and add minitest support (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
matiaseche authored and ashleywillard committed Dec 5, 2023
1 parent ab62d6b commit 326d719
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/packs/rails/integrations/factory_bot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def initialize(app)

Packs.all.reject(&:is_gem?).each do |pack|
app.config.factory_bot.definition_file_paths << pack.relative_path.join("spec/factories").to_s
app.config.factory_bot.definition_file_paths << pack.relative_path.join("test/factories").to_s
end
end
end
Expand Down
7 changes: 5 additions & 2 deletions lib/packs/rails/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ module Rails
class Railtie < ::Rails::Railtie
config.before_configuration do |app|
Integrations::Rails.new(app)
Integrations::FactoryBot.new(app)


# This is not used within packs-rails. Rather, this allows OTHER tools to
# hook into packs-rails via ActiveSupport hooks.
ActiveSupport.run_load_hooks(:packs_rails, Packs)
end

config.after_initialize do |app|
Integrations::FactoryBot.new(app)
end
end
end
end

0 comments on commit 326d719

Please sign in to comment.