solidus_core 2.11.4 → 2.11.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of solidus_core might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/models/spree/address.rb +28 -5
- data/app/models/spree/order_merger.rb +1 -1
- data/app/models/spree/payment.rb +10 -3
- data/app/models/spree/product.rb +8 -2
- data/app/models/spree/shipping_method.rb +1 -1
- data/app/models/spree/stock/availability_validator.rb +2 -2
- data/app/models/spree/stock/inventory_validator.rb +2 -2
- data/app/models/spree/taxon/active_storage_attachment.rb +1 -2
- data/app/models/spree/taxon/paperclip_attachment.rb +1 -0
- data/db/migrate/20210122110141_add_name_to_spree_addresses.rb +13 -0
- data/lib/generators/spree/dummy/templates/rails/test.rb +3 -0
- data/lib/spree/core.rb +0 -4
- data/lib/spree/core/engine.rb +6 -7
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/testing_support.rb +19 -28
- data/lib/spree/testing_support/dummy_app.rb +4 -2
- data/lib/spree/testing_support/dummy_app/mailer_previews/test_mailer_preview.rb +4 -0
- data/lib/spree/testing_support/factories.rb +8 -2
- data/lib/spree/testing_support/factories/address_factory.rb +6 -2
- data/lib/spree/testing_support/factories/adjustment_factory.rb +10 -2
- data/lib/spree/testing_support/factories/adjustment_reason_factory.rb +4 -2
- data/lib/spree/testing_support/factories/calculator_factory.rb +4 -2
- data/lib/spree/testing_support/factories/carton_factory.rb +7 -2
- data/lib/spree/testing_support/factories/country_factory.rb +4 -2
- data/lib/spree/testing_support/factories/credit_card_factory.rb +4 -2
- data/lib/spree/testing_support/factories/customer_return_factory.rb +8 -2
- data/lib/spree/testing_support/factories/image_factory.rb +4 -2
- data/lib/spree/testing_support/factories/inventory_unit_factory.rb +9 -2
- data/lib/spree/testing_support/factories/line_item_factory.rb +7 -2
- data/lib/spree/testing_support/factories/option_type_factory.rb +7 -2
- data/lib/spree/testing_support/factories/option_value_factory.rb +4 -2
- data/lib/spree/testing_support/factories/order_factory.rb +11 -2
- data/lib/spree/testing_support/factories/order_promotion_factory.rb +7 -2
- data/lib/spree/testing_support/factories/payment_factory.rb +9 -2
- data/lib/spree/testing_support/factories/payment_method_factory.rb +4 -2
- data/lib/spree/testing_support/factories/price_factory.rb +6 -2
- data/lib/spree/testing_support/factories/product_factory.rb +10 -2
- data/lib/spree/testing_support/factories/product_option_type_factory.rb +7 -2
- data/lib/spree/testing_support/factories/product_property_factory.rb +7 -2
- data/lib/spree/testing_support/factories/promotion_category_factory.rb +4 -2
- data/lib/spree/testing_support/factories/promotion_code_factory.rb +7 -2
- data/lib/spree/testing_support/factories/promotion_factory.rb +7 -2
- data/lib/spree/testing_support/factories/property_factory.rb +4 -2
- data/lib/spree/testing_support/factories/refund_factory.rb +7 -2
- data/lib/spree/testing_support/factories/refund_reason_factory.rb +4 -2
- data/lib/spree/testing_support/factories/reimbursement_factory.rb +6 -2
- data/lib/spree/testing_support/factories/reimbursement_type_factory.rb +4 -2
- data/lib/spree/testing_support/factories/return_authorization_factory.rb +8 -2
- data/lib/spree/testing_support/factories/return_item_factory.rb +8 -2
- data/lib/spree/testing_support/factories/return_reason_factory.rb +4 -2
- data/lib/spree/testing_support/factories/role_factory.rb +4 -2
- data/lib/spree/testing_support/factories/shipment_factory.rb +9 -2
- data/lib/spree/testing_support/factories/shipping_category_factory.rb +4 -2
- data/lib/spree/testing_support/factories/shipping_method_factory.rb +8 -2
- data/lib/spree/testing_support/factories/shipping_rate_factory.rb +7 -2
- data/lib/spree/testing_support/factories/state_factory.rb +7 -2
- data/lib/spree/testing_support/factories/stock_item_factory.rb +7 -2
- data/lib/spree/testing_support/factories/stock_location_factory.rb +8 -2
- data/lib/spree/testing_support/factories/stock_movement_factory.rb +6 -2
- data/lib/spree/testing_support/factories/stock_package_factory.rb +7 -2
- data/lib/spree/testing_support/factories/store_credit_category_factory.rb +4 -2
- data/lib/spree/testing_support/factories/store_credit_event_factory.rb +7 -2
- data/lib/spree/testing_support/factories/store_credit_factory.rb +8 -2
- data/lib/spree/testing_support/factories/store_credit_reason_factory.rb +4 -2
- data/lib/spree/testing_support/factories/store_credit_type_factory.rb +4 -2
- data/lib/spree/testing_support/factories/store_factory.rb +4 -2
- data/lib/spree/testing_support/factories/tax_category_factory.rb +7 -2
- data/lib/spree/testing_support/factories/tax_rate_factory.rb +8 -2
- data/lib/spree/testing_support/factories/taxon_factory.rb +6 -2
- data/lib/spree/testing_support/factories/taxonomy_factory.rb +4 -2
- data/lib/spree/testing_support/factories/user_factory.rb +8 -2
- data/lib/spree/testing_support/factories/variant_factory.rb +9 -2
- data/lib/spree/testing_support/factories/variant_property_rule_condition_factory.rb +7 -2
- data/lib/spree/testing_support/factories/variant_property_rule_factory.rb +8 -2
- data/lib/spree/testing_support/factories/variant_property_rule_value_factory.rb +7 -2
- data/lib/spree/testing_support/factories/zone_factory.rb +7 -2
- data/lib/spree/testing_support/factory_bot.rb +68 -0
- data/lib/spree/testing_support/order_walkthrough.rb +9 -9
- data/lib/spree/testing_support/sequences.rb +4 -1
- data/lib/tasks/migrations/migrate_address_names.rake +158 -0
- data/lib/tasks/migrations/migrate_default_billing_addresses_to_address_book.rake +38 -0
- data/lib/tasks/upgrade.rake +13 -0
- data/solidus_core.gemspec +23 -1
- metadata +30 -6
- data/lib/spree/awesome_nested_set_override.rb +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e525e5e27176da6331f5bce6a0075f2c06f2da77f9d8aad9d78a861a121219c
|
4
|
+
data.tar.gz: f828d4522d8c58822fc71daa609b7411102dbdcf55e7abb4f582102c23ddbfbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca14ba69f5a7347fd1bc88d8d209e4ffbe2d4a9419fd257f036391d55581250569ac66683a6b5c27a1342f4b5f8120b0483ba16538f8107ded796bda44551c6d
|
7
|
+
data.tar.gz: f36de4fb9dc7addc88b586277f111b854dbbcfba3d586d52a62c2c4aaddc19e6bf536b74151a461df11566d3609df6fbc60889e70b9bbded67dc6ae740ae64dc
|
data/app/models/spree/address.rb
CHANGED
@@ -92,6 +92,12 @@ module Spree
|
|
92
92
|
if base['lastname'].presence || base['last_name'].presence
|
93
93
|
base['lastname'] = name_from_attributes.last_name
|
94
94
|
end
|
95
|
+
|
96
|
+
virtual_name = name_from_attributes.value
|
97
|
+
if base['name'].blank? && virtual_name.present?
|
98
|
+
base['name'] = virtual_name
|
99
|
+
end
|
100
|
+
|
95
101
|
excluded_attributes = DB_ONLY_ATTRS + %w(first_name last_name)
|
96
102
|
|
97
103
|
base.except(*excluded_attributes)
|
@@ -120,7 +126,11 @@ module Spree
|
|
120
126
|
# @return [Boolean] true if the two addresses have the same address fields
|
121
127
|
def ==(other_address)
|
122
128
|
return false unless other_address && other_address.respond_to?(:value_attributes)
|
123
|
-
|
129
|
+
if Spree::Config.use_combined_first_and_last_name_in_address
|
130
|
+
value_attributes.except(*LEGACY_NAME_ATTRS) == other_address.value_attributes.except(*LEGACY_NAME_ATTRS)
|
131
|
+
else
|
132
|
+
value_attributes == other_address.value_attributes
|
133
|
+
end
|
124
134
|
end
|
125
135
|
|
126
136
|
# @deprecated Do not use this. Use Address.== instead.
|
@@ -193,17 +203,30 @@ module Spree
|
|
193
203
|
country && country.iso
|
194
204
|
end
|
195
205
|
|
206
|
+
before_save :set_name_from_firstname_and_lastname
|
207
|
+
|
208
|
+
def set_name_from_firstname_and_lastname
|
209
|
+
name_from_firstname_and_lastname = Spree::Address::Name.from_attributes(attributes.except(:name, 'name'))
|
210
|
+
|
211
|
+
if read_attribute(:name).blank? && name_from_firstname_and_lastname.present?
|
212
|
+
write_attribute(:name, name_from_firstname_and_lastname)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
196
216
|
# @return [String] the full name on this address
|
197
217
|
def name
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
218
|
+
self[:name] || begin
|
219
|
+
Spree::Address::Name.new(
|
220
|
+
read_attribute(:firstname),
|
221
|
+
read_attribute(:lastname)
|
222
|
+
).value
|
223
|
+
end
|
202
224
|
end
|
203
225
|
|
204
226
|
def name=(value)
|
205
227
|
return if value.nil?
|
206
228
|
|
229
|
+
write_attribute(:name, value)
|
207
230
|
name_from_value = Spree::Address::Name.new(value)
|
208
231
|
write_attribute(:firstname, name_from_value.first_name)
|
209
232
|
write_attribute(:lastname, name_from_value.last_name)
|
@@ -128,7 +128,7 @@ module Spree
|
|
128
128
|
# @param [Spree::LineItem] line_item The line item which could not be saved
|
129
129
|
# @return [void]
|
130
130
|
def handle_error(line_item)
|
131
|
-
order.errors
|
131
|
+
order.errors.add(:base, line_item.errors.full_messages)
|
132
132
|
end
|
133
133
|
|
134
134
|
# Save the order totals after merge
|
data/app/models/spree/payment.rb
CHANGED
@@ -168,9 +168,16 @@ module Spree
|
|
168
168
|
|
169
169
|
def validate_source
|
170
170
|
if source && !source.valid?
|
171
|
-
|
172
|
-
|
173
|
-
|
171
|
+
if Gem::Requirement.new(">= 6.1").satisfied_by?(Rails.gem_version)
|
172
|
+
source.errors.each do |error|
|
173
|
+
field_name = I18n.t("activerecord.attributes.#{source.class.to_s.underscore}.#{error.attribute}")
|
174
|
+
errors.add(I18n.t(source.class.to_s.demodulize.underscore, scope: 'spree'), "#{field_name} #{error.message}")
|
175
|
+
end
|
176
|
+
else
|
177
|
+
source.errors.each do |field, error|
|
178
|
+
field_name = I18n.t("activerecord.attributes.#{source.class.to_s.underscore}.#{field}")
|
179
|
+
errors.add(I18n.t(source.class.to_s.demodulize.underscore, scope: 'spree'), "#{field_name} #{error}")
|
180
|
+
end
|
174
181
|
end
|
175
182
|
end
|
176
183
|
if errors.any?
|
data/app/models/spree/product.rb
CHANGED
@@ -366,8 +366,14 @@ module Spree
|
|
366
366
|
# If the master is invalid, the Product object will be assigned its errors
|
367
367
|
def validate_master
|
368
368
|
unless master.valid?
|
369
|
-
|
370
|
-
errors.
|
369
|
+
if Gem::Requirement.new(">= 6.1").satisfied_by?(Rails.gem_version)
|
370
|
+
master.errors.each do |error|
|
371
|
+
errors.add(error.attribute, error.message)
|
372
|
+
end
|
373
|
+
else
|
374
|
+
master.errors.each do |att, error|
|
375
|
+
errors.add(att, error)
|
376
|
+
end
|
371
377
|
end
|
372
378
|
end
|
373
379
|
end
|
@@ -119,7 +119,7 @@ module Spree
|
|
119
119
|
|
120
120
|
def at_least_one_shipping_category
|
121
121
|
if shipping_categories.empty?
|
122
|
-
errors
|
122
|
+
errors.add(:base, "You need to select at least one shipping category")
|
123
123
|
end
|
124
124
|
end
|
125
125
|
end
|
@@ -11,10 +11,10 @@ module Spree
|
|
11
11
|
display_name = variant.name.to_s
|
12
12
|
display_name += %{ (#{variant.options_text})} unless variant.options_text.blank?
|
13
13
|
|
14
|
-
line_item.errors
|
14
|
+
line_item.errors.add(:quantity, I18n.t(
|
15
15
|
'spree.selected_quantity_not_available',
|
16
16
|
item: display_name.inspect
|
17
|
-
)
|
17
|
+
))
|
18
18
|
false
|
19
19
|
end
|
20
20
|
end
|
@@ -5,10 +5,10 @@ module Spree
|
|
5
5
|
class InventoryValidator < ActiveModel::Validator
|
6
6
|
def validate(line_item)
|
7
7
|
if line_item.inventory_units.count != line_item.quantity
|
8
|
-
line_item.errors
|
8
|
+
line_item.errors.add(:inventory, I18n.t(
|
9
9
|
'spree.inventory_not_available',
|
10
10
|
item: line_item.variant.name
|
11
|
-
)
|
11
|
+
))
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -9,11 +9,10 @@ module Spree::Taxon::ActiveStorageAttachment
|
|
9
9
|
styles: { mini: '32x32>', normal: '128x128>' },
|
10
10
|
default_style: :mini
|
11
11
|
validate :icon_is_an_image
|
12
|
-
|
13
|
-
|
14
12
|
end
|
15
13
|
|
16
14
|
def attachment_partial_name
|
15
|
+
Spree::Deprecation.warn("calling #attachment_partial_name on Spree::Taxon is deprecated without replacement.")
|
17
16
|
'paperclip'
|
18
17
|
end
|
19
18
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddNameToSpreeAddresses < ActiveRecord::Migration[5.2]
|
4
|
+
def up
|
5
|
+
add_column :spree_addresses, :name, :string
|
6
|
+
add_index :spree_addresses, :name
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_index :spree_addresses, :name
|
11
|
+
remove_column :spree_addresses, :name
|
12
|
+
end
|
13
|
+
end
|
@@ -20,6 +20,9 @@ Dummy::Application.configure do
|
|
20
20
|
# Raise exceptions instead of rendering exception templates
|
21
21
|
config.action_dispatch.show_exceptions = false
|
22
22
|
|
23
|
+
# Disable request forgery protection in test environment
|
24
|
+
config.action_controller.allow_forgery_protection = false
|
25
|
+
|
23
26
|
# Tell Action Mailer not to deliver emails to the real world.
|
24
27
|
# The :test delivery method accumulates sent emails in the
|
25
28
|
# ActionMailer::Base.deliveries array.
|
data/lib/spree/core.rb
CHANGED
@@ -95,7 +95,3 @@ require 'spree/user_class_handle'
|
|
95
95
|
require 'spree/preferences/store'
|
96
96
|
require 'spree/preferences/static_model_preferences'
|
97
97
|
require 'spree/preferences/scoped_store'
|
98
|
-
|
99
|
-
if Rails.gem_version >= Gem::Version.new('6.1.0.alpha')
|
100
|
-
require 'spree/awesome_nested_set_override'
|
101
|
-
end
|
data/lib/spree/core/engine.rb
CHANGED
@@ -90,15 +90,14 @@ module Spree
|
|
90
90
|
using the external validation class.
|
91
91
|
DEPRECATION
|
92
92
|
end
|
93
|
-
end
|
94
93
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
initializer "spree.mailer_previews" do
|
94
|
+
# Load in mailer previews for apps to use in development.
|
95
|
+
# We need to make sure we call `Preview.all` before requiring our
|
96
|
+
# previews, otherwise any previews the app attempts to add need to be
|
97
|
+
# manually required.
|
98
|
+
if Rails.env.development? || Rails.env.test?
|
101
99
|
ActionMailer::Preview.all
|
100
|
+
|
102
101
|
Dir[root.join("lib/spree/mailer_previews/**/*_preview.rb")].each do |file|
|
103
102
|
require_dependency file
|
104
103
|
end
|
data/lib/spree/core/version.rb
CHANGED
@@ -1,40 +1,31 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'spree/testing_support/factory_bot'
|
4
|
+
|
3
5
|
module Spree
|
4
6
|
module TestingSupport
|
5
|
-
|
6
|
-
FACTORIES = Dir["#{::Spree::Core::Engine.root}/lib/spree/testing_support/factories/**/*_factory.rb"]
|
7
|
-
|
8
|
-
def self.factory_bot_paths
|
9
|
-
@paths ||= (SEQUENCES + FACTORIES).sort.map { |path| path.sub(/.rb\z/, '') }
|
10
|
-
end
|
7
|
+
autoload :FactoryBot, "spree/testing_support/factory_bot"
|
11
8
|
|
12
|
-
|
13
|
-
|
14
|
-
return if caller.find { |line| line.include? "/factory_bot/find_definitions.rb" }
|
9
|
+
autoload :SEQUENCES, "spree/testing_support/factory_bot"
|
10
|
+
autoload :FACTORIES, "spree/testing_support/factory_bot"
|
15
11
|
|
16
|
-
|
17
|
-
|
18
|
-
'Use `require "spree/testing_support/factories"` instead.', caller(2)
|
19
|
-
)
|
12
|
+
def factory_bot_paths
|
13
|
+
Spree::TestingSupport::FactoryBot.definition_file_paths
|
20
14
|
end
|
21
15
|
|
22
|
-
def
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
requirement = Gem::Requirement.new("~> 4.8")
|
27
|
-
version = Gem::Version.new(FactoryBot::VERSION)
|
28
|
-
|
29
|
-
unless requirement.satisfied_by? version
|
30
|
-
Spree::Deprecation.warn(
|
31
|
-
"Please be aware that the supported version of FactoryBot is #{requirement}, " \
|
32
|
-
"using version #{version} could lead to factory loading issues.", caller(2)
|
33
|
-
)
|
34
|
-
end
|
16
|
+
def check_factory_bot_version
|
17
|
+
Spree::TestingSupport::FactoryBot.check_version
|
18
|
+
end
|
35
19
|
|
36
|
-
|
37
|
-
FactoryBot.
|
20
|
+
def load_all_factories
|
21
|
+
Spree::TestingSupport::FactoryBot.add_paths_and_load!
|
38
22
|
end
|
23
|
+
|
24
|
+
deprecate(
|
25
|
+
factory_bot_paths: "Spree::TestingSupport::FactoryBot.definition_file_paths",
|
26
|
+
check_factory_bot_version: "Spree::TestingSupport::FactoryBot.check_version",
|
27
|
+
load_all_factories: "Spree::TestingSupport::FactoryBot.add_paths_and_load!",
|
28
|
+
deprecator: Spree::Deprecator
|
29
|
+
)
|
39
30
|
end
|
40
31
|
end
|
@@ -16,6 +16,7 @@ RAILS_6_OR_ABOVE = Rails.gem_version >= Gem::Version.new('6.0')
|
|
16
16
|
|
17
17
|
# @private
|
18
18
|
class ApplicationController < ActionController::Base
|
19
|
+
protect_from_forgery with: :exception
|
19
20
|
end
|
20
21
|
|
21
22
|
# @private
|
@@ -51,8 +52,8 @@ module DummyApp
|
|
51
52
|
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
|
52
53
|
config.whiny_nils = true
|
53
54
|
config.consider_all_requests_local = true
|
54
|
-
config.action_controller.allow_forgery_protection =
|
55
|
-
config.action_controller.default_protect_from_forgery =
|
55
|
+
config.action_controller.allow_forgery_protection = false
|
56
|
+
config.action_controller.default_protect_from_forgery = false
|
56
57
|
config.action_controller.perform_caching = false
|
57
58
|
config.action_dispatch.show_exceptions = false
|
58
59
|
config.active_support.deprecation = :stderr
|
@@ -61,6 +62,7 @@ module DummyApp
|
|
61
62
|
config.secret_key_base = 'SECRET_TOKEN'
|
62
63
|
|
63
64
|
config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob" if RAILS_6_OR_ABOVE
|
65
|
+
config.action_mailer.preview_path = File.expand_path('dummy_app/mailer_previews', __dir__)
|
64
66
|
config.active_record.sqlite3.represent_boolean_as_integer = true unless RAILS_6_OR_ABOVE
|
65
67
|
|
66
68
|
config.storage_path = Rails.root.join('tmp', 'storage')
|
@@ -1,5 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'spree/testing_support'
|
3
|
+
require 'spree/testing_support/factory_bot'
|
4
4
|
|
5
|
-
Spree::
|
5
|
+
Spree::Deprecation.warn(
|
6
|
+
"Please do not try to load factories directly. " \
|
7
|
+
'Use factory_bot_rails and rely on the default configuration instead.', caller(1)
|
8
|
+
)
|
9
|
+
|
10
|
+
Spree::TestingSupport::FactoryBot.check_version
|
11
|
+
Spree::TestingSupport::FactoryBot::PATHS.each { |path| require path }
|
@@ -1,8 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'spree/testing_support'
|
4
|
-
Spree::TestingSupport.
|
3
|
+
require 'spree/testing_support/factory_bot'
|
4
|
+
Spree::TestingSupport::FactoryBot.when_cherry_picked do
|
5
|
+
Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
|
5
6
|
|
7
|
+
require 'spree/testing_support/factories/state_factory'
|
8
|
+
require 'spree/testing_support/factories/country_factory'
|
9
|
+
end
|
6
10
|
FactoryBot.define do
|
7
11
|
factory :address, class: 'Spree::Address' do
|
8
12
|
transient do
|
@@ -1,7 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'spree/testing_support'
|
4
|
-
Spree::TestingSupport.
|
3
|
+
require 'spree/testing_support/factory_bot'
|
4
|
+
Spree::TestingSupport::FactoryBot.when_cherry_picked do
|
5
|
+
Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
|
6
|
+
|
7
|
+
require 'spree/testing_support/factories/line_item_factory'
|
8
|
+
require 'spree/testing_support/factories/order_factory'
|
9
|
+
require 'spree/testing_support/factories/tax_category_factory'
|
10
|
+
require 'spree/testing_support/factories/tax_rate_factory'
|
11
|
+
require 'spree/testing_support/factories/zone_factory'
|
12
|
+
end
|
5
13
|
|
6
14
|
FactoryBot.define do
|
7
15
|
factory :adjustment, class: 'Spree::Adjustment' do
|
@@ -1,7 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'spree/testing_support'
|
4
|
-
Spree::TestingSupport.
|
3
|
+
require 'spree/testing_support/factory_bot'
|
4
|
+
Spree::TestingSupport::FactoryBot.when_cherry_picked do
|
5
|
+
Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
|
6
|
+
end
|
5
7
|
|
6
8
|
FactoryBot.define do
|
7
9
|
factory :adjustment_reason, class: 'Spree::AdjustmentReason' do
|
@@ -1,7 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'spree/testing_support'
|
4
|
-
Spree::TestingSupport.
|
3
|
+
require 'spree/testing_support/factory_bot'
|
4
|
+
Spree::TestingSupport::FactoryBot.when_cherry_picked do
|
5
|
+
Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
|
6
|
+
end
|
5
7
|
|
6
8
|
FactoryBot.define do
|
7
9
|
factory :calculator, aliases: [:flat_rate_calculator], class: 'Spree::Calculator::FlatRate' do
|
@@ -1,7 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'spree/testing_support'
|
4
|
-
Spree::TestingSupport.
|
3
|
+
require 'spree/testing_support/factory_bot'
|
4
|
+
Spree::TestingSupport::FactoryBot.when_cherry_picked do
|
5
|
+
Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
|
6
|
+
|
7
|
+
require 'spree/testing_support/factories/shipment_factory'
|
8
|
+
require 'spree/testing_support/factories/inventory_unit_factory'
|
9
|
+
end
|
5
10
|
|
6
11
|
FactoryBot.define do
|
7
12
|
factory :carton, class: 'Spree::Carton' do
|
@@ -1,7 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'spree/testing_support'
|
4
|
-
Spree::TestingSupport.
|
3
|
+
require 'spree/testing_support/factory_bot'
|
4
|
+
Spree::TestingSupport::FactoryBot.when_cherry_picked do
|
5
|
+
Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
|
6
|
+
end
|
5
7
|
|
6
8
|
require 'carmen'
|
7
9
|
|