solidus_core 3.4.6 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -1
  3. data/app/helpers/spree/products_helper.rb +1 -1
  4. data/app/models/concerns/spree/active_storage_adapter.rb +0 -17
  5. data/app/models/concerns/spree/default_price.rb +0 -15
  6. data/app/models/concerns/spree/ransackable_attributes.rb +0 -21
  7. data/app/models/spree/adjustment.rb +0 -13
  8. data/app/models/spree/carton.rb +1 -1
  9. data/app/models/spree/fulfilment_changer.rb +2 -14
  10. data/app/models/spree/option_value.rb +2 -11
  11. data/app/models/spree/order.rb +9 -21
  12. data/app/models/spree/order_updater.rb +0 -29
  13. data/app/models/spree/payment.rb +5 -37
  14. data/app/models/spree/product/scopes.rb +0 -5
  15. data/app/models/spree/product.rb +3 -10
  16. data/app/models/spree/promotion/rules/item_total.rb +0 -11
  17. data/app/models/spree/promotion.rb +7 -30
  18. data/app/models/spree/promotion_rule.rb +0 -5
  19. data/app/models/spree/taxon.rb +2 -2
  20. data/app/models/spree/taxonomy.rb +1 -1
  21. data/app/models/spree/variant/price_selector.rb +1 -14
  22. data/app/models/spree/variant.rb +1 -17
  23. data/db/migrate/20210815004823_add_unique_index_to_option_values_variants.rb +16 -0
  24. data/db/migrate/20230321161854_change_column_null_option_values_option_type_id.rb +5 -0
  25. data/db/migrate/20230322085416_remove_match_policy_from_spree_promotion.rb +5 -0
  26. data/db/migrate/20230325132905_remove_unused_columns_from_promotion_rules.rb +6 -0
  27. data/db/migrate/20230325161633_drop_unused_promo_action_line_items.rb +13 -0
  28. data/db/migrate/20230425103509_remove_taxon_position.rb +5 -0
  29. data/db/migrate/20230427095534_drop_deprecated_address_id_from_shipments.rb +11 -0
  30. data/lib/generators/solidus/install/app_templates/frontend/none.rb +1 -2
  31. data/lib/generators/solidus/install/app_templates/frontend/starter.rb +1 -3
  32. data/lib/generators/solidus/install/app_templates/payment_method/paypal.rb +2 -14
  33. data/lib/generators/solidus/install/app_templates/payment_method/stripe.rb +5 -0
  34. data/lib/generators/solidus/install/install_generator.rb +59 -153
  35. data/lib/spree/app_configuration.rb +2 -82
  36. data/lib/spree/bus.rb +0 -11
  37. data/lib/spree/core/controller_helpers/auth.rb +0 -16
  38. data/lib/spree/core/engine.rb +11 -31
  39. data/lib/spree/core/validators/email.rb +0 -4
  40. data/lib/spree/core/version.rb +2 -2
  41. data/lib/spree/core.rb +0 -2
  42. data/lib/spree/migration_helpers.rb +3 -3
  43. data/lib/spree/preferences/preferable_class_methods.rb +1 -25
  44. data/lib/spree/testing_support/common_rake.rb +5 -1
  45. data/lib/spree/testing_support/dummy_app/rake_tasks.rb +4 -8
  46. data/lib/spree/testing_support/dummy_app.rb +1 -6
  47. data/lib/spree/testing_support/factories/address_factory.rb +0 -7
  48. data/lib/spree/testing_support/factories/adjustment_factory.rb +0 -11
  49. data/lib/spree/testing_support/factories/adjustment_reason_factory.rb +0 -5
  50. data/lib/spree/testing_support/factories/calculator_factory.rb +0 -5
  51. data/lib/spree/testing_support/factories/carton_factory.rb +0 -8
  52. data/lib/spree/testing_support/factories/country_factory.rb +0 -5
  53. data/lib/spree/testing_support/factories/credit_card_factory.rb +0 -5
  54. data/lib/spree/testing_support/factories/customer_return_factory.rb +0 -9
  55. data/lib/spree/testing_support/factories/image_factory.rb +0 -5
  56. data/lib/spree/testing_support/factories/inventory_unit_factory.rb +0 -10
  57. data/lib/spree/testing_support/factories/line_item_factory.rb +0 -8
  58. data/lib/spree/testing_support/factories/option_type_factory.rb +0 -8
  59. data/lib/spree/testing_support/factories/option_value_factory.rb +0 -5
  60. data/lib/spree/testing_support/factories/order_factory.rb +0 -12
  61. data/lib/spree/testing_support/factories/order_promotion_factory.rb +0 -8
  62. data/lib/spree/testing_support/factories/payment_factory.rb +0 -10
  63. data/lib/spree/testing_support/factories/payment_method_factory.rb +0 -5
  64. data/lib/spree/testing_support/factories/price_factory.rb +0 -7
  65. data/lib/spree/testing_support/factories/product_factory.rb +0 -11
  66. data/lib/spree/testing_support/factories/product_option_type_factory.rb +0 -8
  67. data/lib/spree/testing_support/factories/product_property_factory.rb +0 -8
  68. data/lib/spree/testing_support/factories/promotion_category_factory.rb +0 -5
  69. data/lib/spree/testing_support/factories/promotion_code_factory.rb +0 -8
  70. data/lib/spree/testing_support/factories/promotion_factory.rb +0 -8
  71. data/lib/spree/testing_support/factories/property_factory.rb +0 -5
  72. data/lib/spree/testing_support/factories/refund_factory.rb +0 -8
  73. data/lib/spree/testing_support/factories/refund_reason_factory.rb +0 -5
  74. data/lib/spree/testing_support/factories/reimbursement_factory.rb +0 -7
  75. data/lib/spree/testing_support/factories/reimbursement_type_factory.rb +0 -5
  76. data/lib/spree/testing_support/factories/return_authorization_factory.rb +0 -9
  77. data/lib/spree/testing_support/factories/return_item_factory.rb +0 -9
  78. data/lib/spree/testing_support/factories/return_reason_factory.rb +0 -5
  79. data/lib/spree/testing_support/factories/role_factory.rb +0 -5
  80. data/lib/spree/testing_support/factories/shipment_factory.rb +0 -10
  81. data/lib/spree/testing_support/factories/shipping_category_factory.rb +0 -5
  82. data/lib/spree/testing_support/factories/shipping_method_factory.rb +0 -9
  83. data/lib/spree/testing_support/factories/shipping_rate_factory.rb +0 -8
  84. data/lib/spree/testing_support/factories/state_factory.rb +0 -8
  85. data/lib/spree/testing_support/factories/stock_item_factory.rb +0 -8
  86. data/lib/spree/testing_support/factories/stock_location_factory.rb +0 -9
  87. data/lib/spree/testing_support/factories/stock_movement_factory.rb +0 -7
  88. data/lib/spree/testing_support/factories/stock_package_factory.rb +0 -8
  89. data/lib/spree/testing_support/factories/store_credit_category_factory.rb +0 -5
  90. data/lib/spree/testing_support/factories/store_credit_event_factory.rb +0 -8
  91. data/lib/spree/testing_support/factories/store_credit_factory.rb +0 -9
  92. data/lib/spree/testing_support/factories/store_credit_reason_factory.rb +0 -5
  93. data/lib/spree/testing_support/factories/store_credit_type_factory.rb +0 -5
  94. data/lib/spree/testing_support/factories/store_factory.rb +0 -5
  95. data/lib/spree/testing_support/factories/tax_category_factory.rb +0 -8
  96. data/lib/spree/testing_support/factories/tax_rate_factory.rb +0 -9
  97. data/lib/spree/testing_support/factories/taxon_factory.rb +0 -7
  98. data/lib/spree/testing_support/factories/taxonomy_factory.rb +0 -5
  99. data/lib/spree/testing_support/factories/user_factory.rb +0 -9
  100. data/lib/spree/testing_support/factories/variant_factory.rb +0 -10
  101. data/lib/spree/testing_support/factories/variant_property_rule_condition_factory.rb +0 -8
  102. data/lib/spree/testing_support/factories/variant_property_rule_factory.rb +0 -9
  103. data/lib/spree/testing_support/factories/variant_property_rule_value_factory.rb +0 -8
  104. data/lib/spree/testing_support/factories/zone_factory.rb +0 -8
  105. data/lib/spree/testing_support/factory_bot.rb +4 -28
  106. data/lib/spree/testing_support/sequences.rb +0 -5
  107. data/solidus_core.gemspec +4 -4
  108. metadata +48 -76
  109. data/app/subscribers/spree/mailer_subscriber.rb +0 -29
  110. data/lib/generators/solidus/install/app_templates/frontend/break_down_solidus_gem.rb +0 -54
  111. data/lib/generators/solidus/install/app_templates/frontend/classic.rb +0 -16
  112. data/lib/generators/solidus/install/app_templates/payment_method/bolt.rb +0 -13
  113. data/lib/spree/core/controller_helpers/current_host.rb +0 -19
  114. data/lib/spree/event/adapters/active_support_notifications.rb +0 -67
  115. data/lib/spree/event/configuration.rb +0 -25
  116. data/lib/spree/event/subscriber.rb +0 -86
  117. data/lib/spree/event/subscriber_registry.rb +0 -92
  118. data/lib/spree/event.rb +0 -119
  119. data/lib/spree/promotion/match_policies.rb +0 -2
  120. data/lib/spree/rails_compatibility.rb +0 -106
  121. data/lib/spree/testing_support/factories.rb +0 -11
  122. data/lib/spree/testing_support.rb +0 -36
  123. data/lib/tasks/solidus/check_orders_with_invalid_email.rake +0 -18
  124. data/lib/tasks/solidus/split_promotions_with_any_match_policy.rake +0 -33
@@ -29,31 +29,7 @@ module Spree::Preferences
29
29
 
30
30
  default = begin
31
31
  given = options[:default]
32
- if ancestors.include?(Spree::Preferences::Configuration) &&
33
- given.is_a?(Proc) &&
34
- given.lambda? &&
35
- given.arity.zero?
36
- Spree::Deprecation.warn <<~MSG
37
- The arity of a proc given as the default for a preference
38
- has changed from 0 to 1 on Solidus 3.1. The Solidus
39
- version for the loaded preference defaults is given as the
40
- proc's argument from this point on.
41
-
42
- If you don't need to return a different default value
43
- depending on the loaded Solidus version, you can change
44
- the proc so that it doesn't have lambda semantics (lambdas
45
- raise when extra arguments are supplied, while raw procs
46
- don't). E.g.:
47
-
48
- preference :foo, :string, default: proc { true }
49
-
50
- If you want to branch on the provided Solidus version, you can do like the following:
51
-
52
- versioned_preference :foo, :string, initial_value: true, boundaries: { "3.2.0" => false }
53
-
54
- MSG
55
- ->(_default_context) { given.call }
56
- elsif given.is_a?(Proc)
32
+ if given.is_a?(Proc)
57
33
  given
58
34
  else
59
35
  proc { given }
@@ -24,7 +24,7 @@ class CommonRakeTasks
24
24
  # While the dummy app is generated the current directory
25
25
  # within ruby is changed to that of the dummy app.
26
26
  sh({
27
- 'FRONTEND' => ENV['FRONTEND'] || 'classic',
27
+ 'FRONTEND' => ENV['FRONTEND'] || 'none',
28
28
  }, [
29
29
  'bin/rails',
30
30
  'generate',
@@ -40,6 +40,10 @@ class CommonRakeTasks
40
40
  "--quiet",
41
41
  ].shelljoin)
42
42
 
43
+ if Bundler.locked_gems.dependencies['solidus_frontend']
44
+ sh "bin/rails g solidus_frontend:install --auto-accept"
45
+ end
46
+
43
47
  puts "Setting up dummy database..."
44
48
 
45
49
  sh "bin/rails db:environment:set RAILS_ENV=test"
@@ -38,14 +38,10 @@ namespace :db do
38
38
  # railties:install:migrations and then db:migrate.
39
39
  # Migrations should be run one directory at a time
40
40
  ActiveRecord::Migrator.migrations_paths.each do |path|
41
- if Rails.gem_version >= Gem::Version.new('6.0.0')
42
- ActiveRecord::MigrationContext.new(
43
- [path],
44
- ActiveRecord::SchemaMigration
45
- ).migrate
46
- else
47
- ActiveRecord::MigrationContext.new([path]).migrate
48
- end
41
+ ActiveRecord::MigrationContext.new(
42
+ [path],
43
+ ActiveRecord::SchemaMigration
44
+ ).migrate
49
45
  end
50
46
 
51
47
  ActiveRecord::Base.clear_cache!
@@ -13,8 +13,6 @@ Rails.env = 'test'
13
13
 
14
14
  require 'solidus_core'
15
15
 
16
- RAILS_6_OR_ABOVE = Rails.gem_version >= Gem::Version.new('6.0')
17
-
18
16
  # @private
19
17
  class ApplicationController < ActionController::Base
20
18
  protect_from_forgery with: :exception
@@ -86,7 +84,6 @@ module DummyApp
86
84
  # Set the preview path within the dummy app:
87
85
  config.action_mailer.preview_path = File.expand_path('dummy_app/mailer_previews', __dir__)
88
86
 
89
- config.active_record.sqlite3.represent_boolean_as_integer = true unless RAILS_6_OR_ABOVE
90
87
  config.active_record.dump_schema_after_migration = false
91
88
 
92
89
  # Configure active storage to use storage within tmp folder
@@ -99,7 +96,7 @@ module DummyApp
99
96
  }
100
97
  }
101
98
  config.active_storage.service = :test
102
- config.active_storage.variant_processor = ENV.fetch('ACTIVE_STORAGE_VARIANT_PROCESSOR', Spree::RailsCompatibility.variant_processor).to_sym
99
+ config.active_storage.variant_processor = ENV.fetch('ACTIVE_STORAGE_VARIANT_PROCESSOR', :vips).to_sym
103
100
  end
104
101
  end
105
102
 
@@ -138,8 +135,6 @@ end
138
135
  Spree.user_class = 'Spree::LegacyUser'
139
136
  Spree.load_defaults(Spree.solidus_version)
140
137
  Spree.config do |config|
141
- config.use_legacy_events = (ENV['USE_LEGACY_EVENTS'] == 'true')
142
-
143
138
  if (ENV['DISABLE_ACTIVE_STORAGE'] == 'true')
144
139
  config.image_attachment_module = 'Spree::Image::PaperclipAttachment'
145
140
  config.taxon_attachment_module = 'Spree::Taxon::PaperclipAttachment'
@@ -1,12 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/state_factory'
8
- require 'spree/testing_support/factories/country_factory'
9
- end
10
3
  FactoryBot.define do
11
4
  factory :address, class: 'Spree::Address' do
12
5
  transient do
@@ -1,16 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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
13
-
14
3
  FactoryBot.define do
15
4
  factory :adjustment, class: 'Spree::Adjustment' do
16
5
  order
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spree/testing_support/factory_bot'
4
- Spree::TestingSupport::FactoryBot.when_cherry_picked do
5
- Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
6
- end
7
-
8
3
  FactoryBot.define do
9
4
  factory :adjustment_reason, class: 'Spree::AdjustmentReason' do
10
5
  sequence(:name) { |n| "Refund for return ##{n}" }
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spree/testing_support/factory_bot'
4
- Spree::TestingSupport::FactoryBot.when_cherry_picked do
5
- Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
6
- end
7
-
8
3
  FactoryBot.define do
9
4
  factory :calculator, aliases: [:flat_rate_calculator], class: 'Spree::Calculator::FlatRate' do
10
5
  preferred_amount { 10.0 }
@@ -1,13 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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
10
-
11
3
  FactoryBot.define do
12
4
  factory :carton, class: 'Spree::Carton' do
13
5
  address
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spree/testing_support/factory_bot'
4
- Spree::TestingSupport::FactoryBot.when_cherry_picked do
5
- Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
6
- end
7
-
8
3
  require 'carmen'
9
4
 
10
5
  FactoryBot.define do
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spree/testing_support/factory_bot'
4
- Spree::TestingSupport::FactoryBot.when_cherry_picked do
5
- Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
6
- end
7
-
8
3
  FactoryBot.define do
9
4
  factory :credit_card, class: 'Spree::CreditCard' do
10
5
  verification_value { 123 }
@@ -1,14 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/stock_location_factory'
8
- require 'spree/testing_support/factories/order_factory'
9
- require 'spree/testing_support/factories/return_item_factory'
10
- end
11
-
12
3
  FactoryBot.define do
13
4
  factory :customer_return, class: 'Spree::CustomerReturn' do
14
5
  association(:stock_location, factory: :stock_location)
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spree/testing_support/factory_bot'
4
- Spree::TestingSupport::FactoryBot.when_cherry_picked do
5
- Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
6
- end
7
-
8
3
  FactoryBot.define do
9
4
  factory :image, class: 'Spree::Image' do
10
5
  attachment { Spree::Core::Engine.root.join('lib', 'spree', 'testing_support', 'fixtures', 'blank.jpg').open }
@@ -1,15 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/variant_factory'
9
- require 'spree/testing_support/factories/order_factory'
10
- require 'spree/testing_support/factories/shipment_factory'
11
- end
12
-
13
3
  FactoryBot.define do
14
4
  factory :inventory_unit, class: 'Spree::InventoryUnit' do
15
5
  transient do
@@ -1,13 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/order_factory'
8
- require 'spree/testing_support/factories/product_factory'
9
- end
10
-
11
3
  FactoryBot.define do
12
4
  factory :line_item, class: 'Spree::LineItem' do
13
5
  quantity { 1 }
@@ -1,13 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/product_factory'
8
- require 'spree/testing_support/factories/option_type_factory'
9
- end
10
-
11
3
  FactoryBot.define do
12
4
  factory :option_type, class: 'Spree::OptionType' do
13
5
  sequence(:name) { |n| "foo-size-#{n}" }
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spree/testing_support/factory_bot'
4
- Spree::TestingSupport::FactoryBot.when_cherry_picked do
5
- Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
6
- end
7
-
8
3
  FactoryBot.define do
9
4
  factory :option_value, class: 'Spree::OptionValue' do
10
5
  sequence(:name) { |n| "Size-#{n}" }
@@ -1,17 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/address_factory'
8
- require 'spree/testing_support/factories/shipment_factory'
9
- require 'spree/testing_support/factories/store_factory'
10
- require 'spree/testing_support/factories/user_factory'
11
- require 'spree/testing_support/factories/line_item_factory'
12
- require 'spree/testing_support/factories/payment_factory'
13
- end
14
-
15
3
  FactoryBot.define do
16
4
  factory :order, class: 'Spree::Order' do
17
5
  user
@@ -1,13 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/order_factory'
8
- require 'spree/testing_support/factories/promotion_factory'
9
- end
10
-
11
3
  FactoryBot.define do
12
4
  factory :order_promotion, class: 'Spree::OrderPromotion' do
13
5
  association :order
@@ -1,15 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/payment_method_factory'
8
- require 'spree/testing_support/factories/credit_card_factory'
9
- require 'spree/testing_support/factories/order_factory'
10
- require 'spree/testing_support/factories/store_credit_factory'
11
- end
12
-
13
3
  FactoryBot.define do
14
4
  factory :payment, aliases: [:credit_card_payment], class: 'Spree::Payment' do
15
5
  association(:payment_method, factory: :credit_card_payment_method)
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spree/testing_support/factory_bot'
4
- Spree::TestingSupport::FactoryBot.when_cherry_picked do
5
- Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
6
- end
7
-
8
3
  FactoryBot.define do
9
4
  factory :payment_method, aliases: [:credit_card_payment_method], class: 'Spree::PaymentMethod::BogusCreditCard' do
10
5
  name { 'Credit Card' }
@@ -1,12 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/variant_factory'
8
- end
9
-
10
3
  FactoryBot.define do
11
4
  factory :price, class: 'Spree::Price' do
12
5
  variant
@@ -1,16 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/sequences'
8
- require 'spree/testing_support/factories/shipping_category_factory'
9
- require 'spree/testing_support/factories/stock_location_factory'
10
- require 'spree/testing_support/factories/tax_category_factory'
11
- require 'spree/testing_support/factories/product_option_type_factory'
12
- end
13
-
14
3
  FactoryBot.define do
15
4
  factory :base_product, class: 'Spree::Product' do
16
5
  sequence(:name) { |n| "Product ##{n} - #{Kernel.rand(9999)}" }
@@ -1,13 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/product_factory'
8
- require 'spree/testing_support/factories/option_type_factory'
9
- end
10
-
11
3
  FactoryBot.define do
12
4
  factory :product_option_type, class: 'Spree::ProductOptionType' do
13
5
  product
@@ -1,13 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/product_factory'
8
- require 'spree/testing_support/factories/property_factory'
9
- end
10
-
11
3
  FactoryBot.define do
12
4
  factory :product_property, class: 'Spree::ProductProperty' do
13
5
  product
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spree/testing_support/factory_bot'
4
- Spree::TestingSupport::FactoryBot.when_cherry_picked do
5
- Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
6
- end
7
-
8
3
  FactoryBot.define do
9
4
  factory :promotion_category, class: 'Spree::PromotionCategory' do
10
5
  name { 'Promotion Category' }
@@ -1,13 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/sequences'
8
- require 'spree/testing_support/factories/promotion_factory'
9
- end
10
-
11
3
  FactoryBot.define do
12
4
  factory :promotion_code, class: 'Spree::PromotionCode' do
13
5
  promotion
@@ -1,13 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/promotion_code_factory'
8
- require 'spree/testing_support/factories/variant_factory'
9
- end
10
-
11
3
  FactoryBot.define do
12
4
  factory :promotion, class: 'Spree::Promotion' do
13
5
  name { 'Promo' }
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spree/testing_support/factory_bot'
4
- Spree::TestingSupport::FactoryBot.when_cherry_picked do
5
- Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
6
- end
7
-
8
3
  FactoryBot.define do
9
4
  factory :property, class: 'Spree::Property' do
10
5
  name { 'baseball_cap_color' }
@@ -1,13 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/payment_factory'
8
- require 'spree/testing_support/factories/refund_reason_factory'
9
- end
10
-
11
3
  FactoryBot.define do
12
4
  sequence(:refund_transaction_id) { |n| "fake-refund-transaction-#{n}" }
13
5
 
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spree/testing_support/factory_bot'
4
- Spree::TestingSupport::FactoryBot.when_cherry_picked do
5
- Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
6
- end
7
-
8
3
  FactoryBot.define do
9
4
  factory :refund_reason, class: 'Spree::RefundReason' do
10
5
  sequence(:name) { |n| "Refund for return ##{n}" }
@@ -1,12 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/customer_return_factory'
8
- end
9
-
10
3
  FactoryBot.define do
11
4
  factory :reimbursement, class: 'Spree::Reimbursement' do
12
5
  transient do
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spree/testing_support/factory_bot'
4
- Spree::TestingSupport::FactoryBot.when_cherry_picked do
5
- Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
6
- end
7
-
8
3
  FactoryBot.define do
9
4
  factory :reimbursement_type, class: 'Spree::ReimbursementType' do
10
5
  sequence(:name) { |n| "Reimbursement Type #{n}" }
@@ -1,14 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/order_factory'
8
- require 'spree/testing_support/factories/stock_location_factory'
9
- require 'spree/testing_support/factories/return_reason_factory'
10
- end
11
-
12
3
  FactoryBot.define do
13
4
  factory :return_authorization, class: 'Spree::ReturnAuthorization' do
14
5
  association(:order, factory: :shipped_order)
@@ -1,14 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/inventory_unit_factory'
8
- require 'spree/testing_support/factories/return_reason_factory'
9
- require 'spree/testing_support/factories/return_authorization_factory'
10
- end
11
-
12
3
  FactoryBot.define do
13
4
  factory :return_item, class: 'Spree::ReturnItem' do
14
5
  association(:inventory_unit, factory: :inventory_unit, state: :shipped)
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spree/testing_support/factory_bot'
4
- Spree::TestingSupport::FactoryBot.when_cherry_picked do
5
- Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
6
- end
7
-
8
3
  FactoryBot.define do
9
4
  factory :return_reason, class: 'Spree::ReturnReason' do
10
5
  sequence(:name) { |n| "Defect ##{n}" }
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spree/testing_support/factory_bot'
4
- Spree::TestingSupport::FactoryBot.when_cherry_picked do
5
- Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
6
- end
7
-
8
3
  FactoryBot.define do
9
4
  factory :role, class: 'Spree::Role' do
10
5
  sequence(:name) { |n| "Role ##{n}" }
@@ -1,15 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/order_factory'
8
- require 'spree/testing_support/factories/stock_location_factory'
9
- require 'spree/testing_support/factories/shipping_method_factory'
10
- end
11
-
12
-
13
3
  FactoryBot.define do
14
4
  factory :shipment, class: 'Spree::Shipment' do
15
5
  tracking { 'U10000' }
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spree/testing_support/factory_bot'
4
- Spree::TestingSupport::FactoryBot.when_cherry_picked do
5
- Spree::TestingSupport::FactoryBot.deprecate_cherry_picking
6
- end
7
-
8
3
  FactoryBot.define do
9
4
  factory :shipping_category, class: 'Spree::ShippingCategory' do
10
5
  sequence(:name) { |n| "ShippingCategory ##{n}" }
@@ -1,14 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/calculator_factory'
8
- require 'spree/testing_support/factories/shipping_category_factory'
9
- require 'spree/testing_support/factories/zone_factory'
10
- end
11
-
12
3
  FactoryBot.define do
13
4
  factory(
14
5
  :shipping_method,
@@ -1,13 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/shipping_method_factory'
8
- require 'spree/testing_support/factories/shipment_factory'
9
- end
10
-
11
3
  FactoryBot.define do
12
4
  factory :shipping_rate, class: 'Spree::ShippingRate' do
13
5
  shipping_method
@@ -1,13 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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/country_factory'
8
- end
9
-
10
-
11
3
  FactoryBot.define do
12
4
  factory :state, class: 'Spree::State' do
13
5
  transient do