Skip to content

Commit

Permalink
Deprecate other code related to old factories loading
Browse files Browse the repository at this point in the history
People should have started to require testing_support/factory_bot
now, so this workaround is no longer needed.

Also no one is calling the methods that check for the version
of factory_bot, so we can safely deprecate that code.
  • Loading branch information
kennyadsl committed Apr 28, 2023
1 parent afa58b4 commit bf5b7aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/lib/spree/testing_support.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# frozen_string_literal: true

require 'spree/testing_support/factory_bot'
require 'spree/deprecation'

Spree::Deprecation.warn <<-WARN
Using `require 'spree/testing_support'` is deprecated and will be removed in
Solidus 4.0.
WARN

module Spree
module TestingSupport
Expand All @@ -11,5 +17,6 @@ module TestingSupport
def check_factory_bot_version
Spree::TestingSupport::FactoryBot.check_version
end
deprecate :check_factory_bot_version, deprecator: Spree::Deprecation
end
end
1 change: 1 addition & 0 deletions core/lib/spree/testing_support/factory_bot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def self.check_version
MSG
end
end
deprecate :check_version, deprecator: Spree::Deprecation

def self.add_definitions!
::FactoryBot.definition_file_paths.unshift(*definition_file_paths).uniq!
Expand Down

0 comments on commit bf5b7aa

Please sign in to comment.