solidus_core 2.9.5 → 2.10.2

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.

Files changed (221) hide show
  1. checksums.yaml +4 -4
  2. data/app/helpers/spree/base_helper.rb +4 -4
  3. data/app/helpers/spree/products_helper.rb +2 -1
  4. data/app/jobs/spree/promotion_code_batch_job.rb +2 -2
  5. data/app/models/concerns/spree/user_address_book.rb +2 -2
  6. data/app/models/concerns/spree/user_methods.rb +2 -2
  7. data/app/models/spree/address.rb +13 -17
  8. data/app/models/spree/adjustment.rb +20 -9
  9. data/app/models/spree/asset.rb +1 -1
  10. data/app/models/spree/base.rb +0 -2
  11. data/app/models/spree/calculator.rb +1 -1
  12. data/app/models/spree/calculator/price_sack.rb +1 -1
  13. data/app/models/spree/calculator/shipping/flexi_rate.rb +2 -2
  14. data/app/models/spree/calculator/tiered_flat_rate.rb +5 -5
  15. data/app/models/spree/calculator/tiered_percent.rb +6 -6
  16. data/app/models/spree/carton.rb +3 -3
  17. data/app/models/spree/classification.rb +2 -2
  18. data/app/models/spree/credit_card.rb +4 -4
  19. data/app/models/spree/customer_return.rb +1 -1
  20. data/app/models/spree/image/paperclip_attachment.rb +1 -1
  21. data/app/models/spree/inventory_unit.rb +5 -23
  22. data/app/models/spree/line_item.rb +4 -4
  23. data/app/models/spree/line_item_action.rb +2 -2
  24. data/app/models/spree/log_entry.rb +1 -1
  25. data/app/models/spree/option_value.rb +1 -1
  26. data/app/models/spree/option_values_variant.rb +2 -2
  27. data/app/models/spree/order.rb +11 -27
  28. data/app/models/spree/order/checkout.rb +1 -1
  29. data/app/models/spree/order/payments.rb +2 -2
  30. data/app/models/spree/order_cancellations.rb +1 -1
  31. data/app/models/spree/order_capturing.rb +2 -2
  32. data/app/models/spree/order_contents.rb +2 -2
  33. data/app/models/spree/order_mutex.rb +1 -1
  34. data/app/models/spree/order_promotion.rb +3 -3
  35. data/app/models/spree/order_shipping.rb +1 -1
  36. data/app/models/spree/order_taxation.rb +3 -3
  37. data/app/models/spree/payment.rb +8 -45
  38. data/app/models/spree/payment/processing.rb +3 -3
  39. data/app/models/spree/payment_capture_event.rb +1 -1
  40. data/app/models/spree/payment_method.rb +5 -2
  41. data/app/models/spree/payment_method/bogus_credit_card.rb +1 -1
  42. data/app/models/spree/payment_source.rb +1 -1
  43. data/app/models/spree/price.rb +2 -2
  44. data/app/models/spree/product.rb +5 -5
  45. data/app/models/spree/product/scopes.rb +218 -210
  46. data/app/models/spree/product_option_type.rb +2 -2
  47. data/app/models/spree/product_promotion_rule.rb +2 -2
  48. data/app/models/spree/product_property.rb +2 -2
  49. data/app/models/spree/promotion.rb +28 -13
  50. data/app/models/spree/promotion/actions/create_quantity_adjustments.rb +1 -1
  51. data/app/models/spree/promotion/actions/free_shipping.rb +1 -1
  52. data/app/models/spree/promotion/rules/option_value.rb +2 -2
  53. data/app/models/spree/promotion/rules/product.rb +3 -3
  54. data/app/models/spree/promotion_action.rb +2 -2
  55. data/app/models/spree/promotion_chooser.rb +2 -2
  56. data/app/models/spree/promotion_code.rb +11 -10
  57. data/app/models/spree/promotion_code/batch_builder.rb +3 -3
  58. data/app/models/spree/promotion_code_batch.rb +1 -1
  59. data/app/models/spree/promotion_rule.rb +2 -2
  60. data/app/models/spree/promotion_rule_role.rb +2 -2
  61. data/app/models/spree/promotion_rule_store.rb +2 -2
  62. data/app/models/spree/promotion_rule_taxon.rb +2 -2
  63. data/app/models/spree/promotion_rule_user.rb +2 -2
  64. data/app/models/spree/refund.rb +5 -5
  65. data/app/models/spree/reimbursement.rb +5 -13
  66. data/app/models/spree/reimbursement/credit.rb +2 -2
  67. data/app/models/spree/reimbursement/reimbursement_type_engine.rb +1 -1
  68. data/app/models/spree/reimbursement_tax_calculator.rb +1 -1
  69. data/app/models/spree/reimbursement_type/reimbursement_helpers.rb +2 -2
  70. data/app/models/spree/return_authorization.rb +4 -10
  71. data/app/models/spree/return_item.rb +13 -52
  72. data/app/models/spree/return_item/eligibility_validator/default.rb +1 -1
  73. data/app/models/spree/role_user.rb +2 -2
  74. data/app/models/spree/shipment.rb +7 -41
  75. data/app/models/spree/shipping_calculator.rb +0 -4
  76. data/app/models/spree/shipping_manifest.rb +3 -3
  77. data/app/models/spree/shipping_method.rb +2 -2
  78. data/app/models/spree/shipping_method_category.rb +2 -2
  79. data/app/models/spree/shipping_method_stock_location.rb +2 -2
  80. data/app/models/spree/shipping_method_zone.rb +2 -2
  81. data/app/models/spree/shipping_rate.rb +2 -2
  82. data/app/models/spree/shipping_rate_tax.rb +2 -2
  83. data/app/models/spree/state.rb +2 -2
  84. data/app/models/spree/state_change.rb +2 -2
  85. data/app/models/spree/stock/differentiator.rb +1 -1
  86. data/app/models/spree/stock/package.rb +1 -1
  87. data/app/models/spree/stock_item.rb +3 -3
  88. data/app/models/spree/stock_location.rb +2 -2
  89. data/app/models/spree/stock_movement.rb +2 -2
  90. data/app/models/spree/stock_quantities.rb +13 -12
  91. data/app/models/spree/store_credit.rb +8 -8
  92. data/app/models/spree/store_credit_event.rb +3 -3
  93. data/app/models/spree/store_payment_method.rb +2 -2
  94. data/app/models/spree/store_shipping_method.rb +2 -2
  95. data/app/models/spree/tax_calculator/default.rb +0 -4
  96. data/app/models/spree/tax_calculator/shipping_rate.rb +0 -3
  97. data/app/models/spree/tax_rate.rb +5 -1
  98. data/app/models/spree/tax_rate_tax_category.rb +2 -2
  99. data/app/models/spree/taxon/paperclip_attachment.rb +13 -0
  100. data/app/models/spree/unit_cancel.rb +5 -2
  101. data/app/models/spree/user_address.rb +2 -2
  102. data/app/models/spree/user_last_url_storer.rb +46 -0
  103. data/app/models/spree/user_last_url_storer/rules/authentication_rule.rb +36 -0
  104. data/app/models/spree/user_stock_location.rb +2 -2
  105. data/app/models/spree/variant.rb +10 -10
  106. data/app/models/spree/variant/scopes.rb +37 -29
  107. data/app/models/spree/variant_property_rule.rb +1 -1
  108. data/app/models/spree/variant_property_rule_condition.rb +2 -2
  109. data/app/models/spree/variant_property_rule_value.rb +2 -2
  110. data/app/models/spree/wallet/add_payment_sources_to_wallet.rb +1 -1
  111. data/app/models/spree/wallet_payment_source.rb +2 -2
  112. data/app/models/spree/zone.rb +1 -1
  113. data/app/models/spree/zone_member.rb +2 -2
  114. data/config/initializers/inflections.rb +5 -0
  115. data/config/initializers/money.rb +2 -0
  116. data/config/locales/en.yml +34 -3
  117. data/lib/generators/spree/dummy/dummy_generator.rb +2 -0
  118. data/lib/generators/spree/install/templates/config/initializers/spree.rb.tt +8 -0
  119. data/lib/spree/app_configuration.rb +18 -3
  120. data/lib/spree/core.rb +12 -0
  121. data/lib/spree/core/controller_helpers/auth.rb +1 -13
  122. data/lib/spree/core/controller_helpers/strong_parameters.rb +21 -7
  123. data/lib/spree/core/engine.rb +2 -2
  124. data/lib/spree/core/importer/order.rb +29 -28
  125. data/lib/spree/core/importer/product.rb +2 -2
  126. data/lib/spree/core/product_filters.rb +15 -15
  127. data/lib/spree/core/role_configuration.rb +2 -2
  128. data/lib/spree/core/search/variant.rb +1 -1
  129. data/lib/spree/core/state_machines.rb +78 -0
  130. data/lib/spree/core/state_machines/inventory_unit.rb +42 -0
  131. data/lib/spree/core/state_machines/payment.rb +61 -0
  132. data/lib/spree/core/state_machines/reimbursement.rb +33 -0
  133. data/lib/spree/core/state_machines/return_authorization.rb +32 -0
  134. data/lib/spree/core/state_machines/return_item/acceptance_status.rb +51 -0
  135. data/lib/spree/core/state_machines/return_item/reception_status.rb +42 -0
  136. data/lib/spree/core/state_machines/shipment.rb +58 -0
  137. data/lib/spree/core/stock_configuration.rb +1 -0
  138. data/lib/spree/core/validators/email.rb +1 -8
  139. data/lib/spree/core/version.rb +1 -1
  140. data/lib/spree/money.rb +2 -2
  141. data/lib/spree/permission_sets/default_customer.rb +1 -1
  142. data/lib/spree/permission_sets/user_management.rb +3 -0
  143. data/lib/spree/permitted_attributes.rb +78 -9
  144. data/lib/spree/preferences/static_model_preferences.rb +2 -2
  145. data/lib/spree/testing_support/dummy_app.rb +4 -1
  146. data/lib/spree/testing_support/dummy_app/rake_tasks.rb +6 -2
  147. data/lib/spree/testing_support/factories/inventory_unit_factory.rb +8 -1
  148. data/lib/spree/testing_support/factories/promotion_factory.rb +7 -0
  149. data/lib/spree/testing_support/factories/stock_package_factory.rb +1 -1
  150. data/lib/spree/testing_support/factories/user_factory.rb +4 -1
  151. data/solidus_core.gemspec +6 -6
  152. data/spec/lib/search/base_spec.rb +5 -1
  153. data/spec/lib/search/variant_spec.rb +1 -1
  154. data/spec/lib/spree/core/controller_helpers/strong_parameters_spec.rb +8 -1
  155. data/spec/lib/spree/core/stock_configuration_spec.rb +36 -0
  156. data/spec/lib/spree/core/validators/email_spec.rb +18 -18
  157. data/spec/lib/spree/event_spec.rb +15 -3
  158. data/spec/lib/spree/permitted_attributes_spec.rb +41 -0
  159. data/spec/models/spree/ability_spec.rb +1 -1
  160. data/spec/models/spree/address_spec.rb +23 -0
  161. data/spec/models/spree/calculator/refunds/default_refund_amount_spec.rb +1 -1
  162. data/spec/models/spree/calculator/shipping/flat_percent_item_total_spec.rb +1 -1
  163. data/spec/models/spree/calculator/shipping/flat_rate_spec.rb +1 -1
  164. data/spec/models/spree/calculator/shipping/flexi_rate_spec.rb +2 -2
  165. data/spec/models/spree/calculator/shipping/per_item_spec.rb +1 -1
  166. data/spec/models/spree/calculator/shipping/price_sack_spec.rb +24 -15
  167. data/spec/models/spree/carton_spec.rb +10 -2
  168. data/spec/models/spree/classification_spec.rb +21 -9
  169. data/spec/models/spree/concerns/user_address_book_spec.rb +4 -4
  170. data/spec/models/spree/concerns/user_methods_spec.rb +5 -4
  171. data/spec/models/spree/credit_card_spec.rb +2 -2
  172. data/spec/models/spree/customer_return_spec.rb +1 -1
  173. data/spec/models/spree/order/checkout_spec.rb +1 -1
  174. data/spec/models/spree/order/outstanding_balance_integration_spec.rb +5 -5
  175. data/spec/models/spree/order/payment_spec.rb +1 -1
  176. data/spec/models/spree/order_contents_spec.rb +1 -1
  177. data/spec/models/spree/order_inventory_spec.rb +3 -3
  178. data/spec/models/spree/order_merger_spec.rb +3 -3
  179. data/spec/models/spree/order_shipping_spec.rb +1 -1
  180. data/spec/models/spree/order_spec.rb +14 -21
  181. data/spec/models/spree/order_updater_spec.rb +4 -3
  182. data/spec/models/spree/payment_create_spec.rb +6 -16
  183. data/spec/models/spree/payment_spec.rb +12 -12
  184. data/spec/models/spree/permission_sets/user_management_spec.rb +2 -0
  185. data/spec/models/spree/preference_spec.rb +4 -4
  186. data/spec/models/spree/preferences/preferable_spec.rb +3 -3
  187. data/spec/models/spree/preferences/statically_configurable_spec.rb +2 -2
  188. data/spec/models/spree/promotion/rules/first_repeat_purchase_since_spec.rb +2 -2
  189. data/spec/models/spree/promotion/rules/nth_order_spec.rb +2 -2
  190. data/spec/models/spree/promotion/rules/taxon_spec.rb +1 -0
  191. data/spec/models/spree/promotion_rule_spec.rb +6 -6
  192. data/spec/models/spree/promotion_spec.rb +71 -54
  193. data/spec/models/spree/reimbursement_type/original_payment_spec.rb +3 -3
  194. data/spec/models/spree/return_item/exchange_variant_eligibility/same_product_spec.rb +1 -1
  195. data/spec/models/spree/return_item_spec.rb +11 -11
  196. data/spec/models/spree/returns_calculator_spec.rb +2 -2
  197. data/spec/models/spree/shipment_spec.rb +6 -6
  198. data/spec/models/spree/shipping_calculator_spec.rb +1 -13
  199. data/spec/models/spree/shipping_method_spec.rb +32 -0
  200. data/spec/models/spree/stock/availability_validator_spec.rb +2 -2
  201. data/spec/models/spree/stock/differentiator_spec.rb +2 -2
  202. data/spec/models/spree/stock/estimator_spec.rb +3 -3
  203. data/spec/models/spree/stock/inventory_units_finalizer_spec.rb +4 -4
  204. data/spec/models/spree/stock/package_spec.rb +28 -28
  205. data/spec/models/spree/stock/quantifier_spec.rb +2 -2
  206. data/spec/models/spree/stock/simple_coordinator_spec.rb +11 -11
  207. data/spec/models/spree/stock/splitter/base_spec.rb +4 -4
  208. data/spec/models/spree/stock/splitter/shipping_category_spec.rb +7 -7
  209. data/spec/models/spree/stock_quantities_spec.rb +1 -1
  210. data/spec/models/spree/store_credit_spec.rb +8 -8
  211. data/spec/models/spree/tax_category_spec.rb +1 -1
  212. data/spec/models/spree/tax_rate_spec.rb +1 -0
  213. data/spec/models/spree/taxon_spec.rb +2 -2
  214. data/spec/models/spree/taxons/paperclip_attachment_spec.rb +29 -0
  215. data/spec/models/spree/unit_cancel_spec.rb +5 -0
  216. data/spec/models/spree/user_last_url_storer/rules/authentication_rule_spec.rb +31 -0
  217. data/spec/models/spree/user_last_url_storer_spec.rb +60 -0
  218. data/spec/models/spree/user_spec.rb +3 -3
  219. metadata +46 -39
  220. data/spec/migrate/20190106184413_remove_code_from_spree_promotions_spec.rb +0 -148
  221. data/spec/models/spree/order/updating_spec.rb +0 -18
@@ -200,12 +200,12 @@ RSpec.describe Spree.user_class, type: :model do
200
200
  context "part of the store credit has been used" do
201
201
  let(:amount_used) { 35.00 }
202
202
 
203
- before { store_credit.update_attributes(amount_used: amount_used) }
203
+ before { store_credit.update(amount_used: amount_used) }
204
204
 
205
205
  context "part of the store credit has been authorized" do
206
206
  let(:authorized_amount) { 10 }
207
207
 
208
- before { additional_store_credit.update_attributes(amount_authorized: authorized_amount) }
208
+ before { additional_store_credit.update(amount_authorized: authorized_amount) }
209
209
 
210
210
  it "returns sum of amounts minus used amount and authorized amount" do
211
211
  expect(subject.total_available_store_credit.to_f).to eq(amount + additional_amount - amount_used - authorized_amount)
@@ -223,7 +223,7 @@ RSpec.describe Spree.user_class, type: :model do
223
223
  context "part of the store credit has been authorized" do
224
224
  let(:authorized_amount) { 10 }
225
225
 
226
- before { additional_store_credit.update_attributes(amount_authorized: authorized_amount) }
226
+ before { additional_store_credit.update(amount_authorized: authorized_amount) }
227
227
 
228
228
  it "returns sum of amounts minus authorized amount" do
229
229
  expect(subject.total_available_store_credit.to_f).to eq(amount + additional_amount - authorized_amount)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.5
4
+ version: 2.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-04 00:00:00.000000000 Z
11
+ date: 2020-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '5.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 5.3.x
22
+ version: 7.0.x
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '5.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 5.3.x
32
+ version: 7.0.x
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: actionpack
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: '5.1'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: 5.3.x
42
+ version: 7.0.x
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: '5.1'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: 5.3.x
52
+ version: 7.0.x
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: actionview
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -59,7 +59,7 @@ dependencies:
59
59
  version: '5.1'
60
60
  - - "<"
61
61
  - !ruby/object:Gem::Version
62
- version: 5.3.x
62
+ version: 7.0.x
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
@@ -69,7 +69,7 @@ dependencies:
69
69
  version: '5.1'
70
70
  - - "<"
71
71
  - !ruby/object:Gem::Version
72
- version: 5.3.x
72
+ version: 7.0.x
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: activejob
75
75
  requirement: !ruby/object:Gem::Requirement
@@ -79,7 +79,7 @@ dependencies:
79
79
  version: '5.1'
80
80
  - - "<"
81
81
  - !ruby/object:Gem::Version
82
- version: 5.3.x
82
+ version: 7.0.x
83
83
  type: :runtime
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
@@ -89,7 +89,7 @@ dependencies:
89
89
  version: '5.1'
90
90
  - - "<"
91
91
  - !ruby/object:Gem::Version
92
- version: 5.3.x
92
+ version: 7.0.x
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: activemodel
95
95
  requirement: !ruby/object:Gem::Requirement
@@ -99,7 +99,7 @@ dependencies:
99
99
  version: '5.1'
100
100
  - - "<"
101
101
  - !ruby/object:Gem::Version
102
- version: 5.3.x
102
+ version: 7.0.x
103
103
  type: :runtime
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: '5.1'
110
110
  - - "<"
111
111
  - !ruby/object:Gem::Version
112
- version: 5.3.x
112
+ version: 7.0.x
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: activerecord
115
115
  requirement: !ruby/object:Gem::Requirement
@@ -119,7 +119,7 @@ dependencies:
119
119
  version: '5.1'
120
120
  - - "<"
121
121
  - !ruby/object:Gem::Version
122
- version: 5.3.x
122
+ version: 7.0.x
123
123
  type: :runtime
124
124
  prerelease: false
125
125
  version_requirements: !ruby/object:Gem::Requirement
@@ -129,7 +129,7 @@ dependencies:
129
129
  version: '5.1'
130
130
  - - "<"
131
131
  - !ruby/object:Gem::Version
132
- version: 5.3.x
132
+ version: 7.0.x
133
133
  - !ruby/object:Gem::Dependency
134
134
  name: activesupport
135
135
  requirement: !ruby/object:Gem::Requirement
@@ -139,7 +139,7 @@ dependencies:
139
139
  version: '5.1'
140
140
  - - "<"
141
141
  - !ruby/object:Gem::Version
142
- version: 5.3.x
142
+ version: 7.0.x
143
143
  type: :runtime
144
144
  prerelease: false
145
145
  version_requirements: !ruby/object:Gem::Requirement
@@ -149,7 +149,7 @@ dependencies:
149
149
  version: '5.1'
150
150
  - - "<"
151
151
  - !ruby/object:Gem::Version
152
- version: 5.3.x
152
+ version: 7.0.x
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: railties
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -159,7 +159,7 @@ dependencies:
159
159
  version: '5.1'
160
160
  - - "<"
161
161
  - !ruby/object:Gem::Version
162
- version: 5.3.x
162
+ version: 7.0.x
163
163
  type: :runtime
164
164
  prerelease: false
165
165
  version_requirements: !ruby/object:Gem::Requirement
@@ -169,7 +169,7 @@ dependencies:
169
169
  version: '5.1'
170
170
  - - "<"
171
171
  - !ruby/object:Gem::Version
172
- version: 5.3.x
172
+ version: 7.0.x
173
173
  - !ruby/object:Gem::Dependency
174
174
  name: activemerchant
175
175
  requirement: !ruby/object:Gem::Requirement
@@ -204,34 +204,34 @@ dependencies:
204
204
  requirements:
205
205
  - - "~>"
206
206
  - !ruby/object:Gem::Version
207
- version: '3.0'
208
- - - ">="
209
- - !ruby/object:Gem::Version
210
- version: 3.0.1
207
+ version: '3.2'
211
208
  type: :runtime
212
209
  prerelease: false
213
210
  version_requirements: !ruby/object:Gem::Requirement
214
211
  requirements:
215
212
  - - "~>"
216
213
  - !ruby/object:Gem::Version
217
- version: '3.0'
218
- - - ">="
219
- - !ruby/object:Gem::Version
220
- version: 3.0.1
214
+ version: '3.2'
221
215
  - !ruby/object:Gem::Dependency
222
216
  name: cancancan
223
217
  requirement: !ruby/object:Gem::Requirement
224
218
  requirements:
225
- - - "~>"
219
+ - - ">="
226
220
  - !ruby/object:Gem::Version
227
221
  version: '2.2'
222
+ - - "<"
223
+ - !ruby/object:Gem::Version
224
+ version: '4.0'
228
225
  type: :runtime
229
226
  prerelease: false
230
227
  version_requirements: !ruby/object:Gem::Requirement
231
228
  requirements:
232
- - - "~>"
229
+ - - ">="
233
230
  - !ruby/object:Gem::Version
234
231
  version: '2.2'
232
+ - - "<"
233
+ - !ruby/object:Gem::Version
234
+ version: '4.0'
235
235
  - !ruby/object:Gem::Dependency
236
236
  name: carmen
237
237
  requirement: !ruby/object:Gem::Requirement
@@ -309,9 +309,6 @@ dependencies:
309
309
  - - ">="
310
310
  - !ruby/object:Gem::Version
311
311
  version: '4.2'
312
- - - "<"
313
- - !ruby/object:Gem::Version
314
- version: '6'
315
312
  type: :runtime
316
313
  prerelease: false
317
314
  version_requirements: !ruby/object:Gem::Requirement
@@ -319,9 +316,6 @@ dependencies:
319
316
  - - ">="
320
317
  - !ruby/object:Gem::Version
321
318
  version: '4.2'
322
- - - "<"
323
- - !ruby/object:Gem::Version
324
- version: '6'
325
319
  - !ruby/object:Gem::Dependency
326
320
  name: paranoia
327
321
  requirement: !ruby/object:Gem::Requirement
@@ -356,14 +350,14 @@ dependencies:
356
350
  requirements:
357
351
  - - "~>"
358
352
  - !ruby/object:Gem::Version
359
- version: '0.4'
353
+ version: '0.6'
360
354
  type: :runtime
361
355
  prerelease: false
362
356
  version_requirements: !ruby/object:Gem::Requirement
363
357
  requirements:
364
358
  - - "~>"
365
359
  - !ruby/object:Gem::Version
366
- version: '0.4'
360
+ version: '0.6'
367
361
  description: Essential models, mailers, and classes for the Solidus e-commerce project.
368
362
  email: contact@solidus.io
369
363
  executables: []
@@ -619,6 +613,8 @@ files:
619
613
  - app/models/spree/unit_cancel.rb
620
614
  - app/models/spree/user_address.rb
621
615
  - app/models/spree/user_class_handle.rb
616
+ - app/models/spree/user_last_url_storer.rb
617
+ - app/models/spree/user_last_url_storer/rules/authentication_rule.rb
622
618
  - app/models/spree/user_stock_location.rb
623
619
  - app/models/spree/validations/db_maximum_length_validator.rb
624
620
  - app/models/spree/variant.rb
@@ -656,6 +652,7 @@ files:
656
652
  - app/views/spree/test_mailer/test_email.text.erb
657
653
  - config/initializers/assets.rb
658
654
  - config/initializers/friendly_id.rb
655
+ - config/initializers/inflections.rb
659
656
  - config/initializers/money.rb
660
657
  - config/locales/en.yml
661
658
  - db/default/spree/countries.rb
@@ -741,6 +738,14 @@ files:
741
738
  - lib/spree/core/role_configuration.rb
742
739
  - lib/spree/core/search/base.rb
743
740
  - lib/spree/core/search/variant.rb
741
+ - lib/spree/core/state_machines.rb
742
+ - lib/spree/core/state_machines/inventory_unit.rb
743
+ - lib/spree/core/state_machines/payment.rb
744
+ - lib/spree/core/state_machines/reimbursement.rb
745
+ - lib/spree/core/state_machines/return_authorization.rb
746
+ - lib/spree/core/state_machines/return_item/acceptance_status.rb
747
+ - lib/spree/core/state_machines/return_item/reception_status.rb
748
+ - lib/spree/core/state_machines/shipment.rb
744
749
  - lib/spree/core/stock_configuration.rb
745
750
  - lib/spree/core/validators/email.rb
746
751
  - lib/spree/core/version.rb
@@ -971,6 +976,7 @@ files:
971
976
  - spec/lib/spree/migrations_spec.rb
972
977
  - spec/lib/spree/money_spec.rb
973
978
  - spec/lib/spree/permission_sets/default_customer_spec.rb
979
+ - spec/lib/spree/permitted_attributes_spec.rb
974
980
  - spec/lib/spree/promo/environment_spec.rb
975
981
  - spec/lib/tasks/dummy_task.rake
976
982
  - spec/lib/tasks/dummy_task_spec.rb
@@ -980,7 +986,6 @@ files:
980
986
  - spec/mailers/promotion_code_batch_mailer_spec.rb
981
987
  - spec/mailers/reimbursement_mailer_spec.rb
982
988
  - spec/mailers/test_mailer_spec.rb
983
- - spec/migrate/20190106184413_remove_code_from_spree_promotions_spec.rb
984
989
  - spec/models/spree/ability_spec.rb
985
990
  - spec/models/spree/address_spec.rb
986
991
  - spec/models/spree/adjustment_reason_spec.rb
@@ -1037,7 +1042,6 @@ files:
1037
1042
  - spec/models/spree/order/risk_assessment_spec.rb
1038
1043
  - spec/models/spree/order/state_machine_spec.rb
1039
1044
  - spec/models/spree/order/totals_spec.rb
1040
- - spec/models/spree/order/updating_spec.rb
1041
1045
  - spec/models/spree/order/validations_spec.rb
1042
1046
  - spec/models/spree/order_cancellations_spec.rb
1043
1047
  - spec/models/spree/order_capturing_spec.rb
@@ -1185,7 +1189,10 @@ files:
1185
1189
  - spec/models/spree/tax_rate_spec.rb
1186
1190
  - spec/models/spree/taxon_spec.rb
1187
1191
  - spec/models/spree/taxonomy_spec.rb
1192
+ - spec/models/spree/taxons/paperclip_attachment_spec.rb
1188
1193
  - spec/models/spree/unit_cancel_spec.rb
1194
+ - spec/models/spree/user_last_url_storer/rules/authentication_rule_spec.rb
1195
+ - spec/models/spree/user_last_url_storer_spec.rb
1189
1196
  - spec/models/spree/user_spec.rb
1190
1197
  - spec/models/spree/validations/db_maximum_length_validator_spec.rb
1191
1198
  - spec/models/spree/variant/price_selector_spec.rb
@@ -1222,7 +1229,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
1222
1229
  requirements:
1223
1230
  - - ">="
1224
1231
  - !ruby/object:Gem::Version
1225
- version: 2.2.2
1232
+ version: 2.4.0
1226
1233
  required_rubygems_version: !ruby/object:Gem::Requirement
1227
1234
  requirements:
1228
1235
  - - ">="
@@ -1,148 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rails_helper'
4
- require Spree::Core::Engine.root.join('db/migrate/20190106184413_remove_code_from_spree_promotions.rb')
5
-
6
- RSpec.describe RemoveCodeFromSpreePromotions do
7
- let(:migrations_paths) { ActiveRecord::Migrator.migrations_paths }
8
- let(:migrations) do
9
- if ActiveRecord::Base.connection.respond_to?(:migration_context)
10
- # Rails >= 5.2
11
- ActiveRecord::MigrationContext.new(migrations_paths).migrations
12
- else
13
- ActiveRecord::Migrator.migrations(migrations_paths)
14
- end
15
- end
16
- let(:previous_version) { 20180710170104 }
17
- let(:current_version) { 20190106184413 }
18
-
19
- subject { ActiveRecord::Migrator.new(:up, migrations, current_version).migrate }
20
-
21
- # This is needed for MySQL since it is not able to rollback to the previous
22
- # state when database schema changes within that transaction.
23
- before(:all) { self.use_transactional_tests = false }
24
- after(:all) { self.use_transactional_tests = true }
25
-
26
- around do |example|
27
- DatabaseCleaner.clean_with(:truncation)
28
- # Silence migrations output in specs report.
29
- ActiveRecord::Migration.suppress_messages do
30
- # Migrate back to the previous version
31
- ActiveRecord::Migrator.new(:down, migrations, previous_version).migrate
32
- # If other tests using Spree::Promotion ran before this one, Rails has
33
- # stored information about table's columns and we need to reset those
34
- # since the migration changed the database structure.
35
- Spree::Promotion.reset_column_information
36
-
37
- example.run
38
-
39
- # Re-update column information after the migration has been executed
40
- # again in the example. This will make the promotion attributes cache
41
- # ready for other tests.
42
- Spree::Promotion.reset_column_information
43
- end
44
- DatabaseCleaner.clean_with(:truncation)
45
- end
46
-
47
- let(:promotion_with_code) { create(:promotion) }
48
-
49
- before do
50
- # We can't set code via factory since `code=` is currently raising
51
- # an error, see more at:
52
- # https://github.com/solidusio/solidus/blob/cf96b03eb9e80002b69736e082fd485c870ab5d9/core/app/models/spree/promotion.rb#L65
53
- promotion_with_code.update_column(:code, code)
54
- end
55
-
56
- context 'when there are no promotions with code' do
57
- let(:code) { '' }
58
-
59
- it 'does not call any promotion with code handler' do
60
- expect(described_class).not_to receive(:promotions_with_code_handler)
61
-
62
- subject
63
- end
64
- end
65
-
66
- context 'when there are promotions with code' do
67
- let(:code) { 'Just An Old Promo Code' }
68
-
69
- context 'with the deafult handler (Solidus::Migrations::PromotionWithCodeHandlers::RaiseException)' do
70
- it 'raise a StandardError exception' do
71
- expect { subject }.to raise_error(StandardError)
72
- end
73
- end
74
-
75
- context 'changing the default handler' do
76
- before do
77
- allow(described_class)
78
- .to receive(:promotions_with_code_handler)
79
- .and_return(promotions_with_code_handler)
80
- end
81
-
82
- context 'to Solidus::Migrations::PromotionWithCodeHandlers::MoveToSpreePromotionCode' do
83
- let(:promotions_with_code_handler) { Solidus::Migrations::PromotionWithCodeHandlers::MoveToSpreePromotionCode }
84
-
85
- context 'when there are no Spree::PromotionCode with the same value' do
86
- it 'moves the code into a Spree::PromotionCode' do
87
- migration_context = double('a migration context')
88
- allow_any_instance_of(promotions_with_code_handler)
89
- .to receive(:migration_context)
90
- .and_return(migration_context)
91
-
92
- expect(migration_context)
93
- .to receive(:say)
94
- .with("Creating Spree::PromotionCode with value 'just an old promo code' for Spree::Promotion with id '#{promotion_with_code.id}'")
95
-
96
- expect { subject }
97
- .to change { Spree::PromotionCode.all.size }
98
- .from(0)
99
- .to(1)
100
- end
101
- end
102
-
103
- context 'with promotions with type set (legacy feature)' do
104
- let(:promotion_with_code) { create(:promotion, type: 'Spree::Promotion') }
105
-
106
- it 'does not raise a STI error' do
107
- expect { subject }.not_to raise_error
108
- end
109
- end
110
-
111
- context 'when there is a Spree::PromotionCode with the same value' do
112
- context 'associated with the same promotion' do
113
- let!(:existing_promotion_code) { create(:promotion_code, value: 'just an old promo code', promotion: promotion_with_code) }
114
-
115
- it 'does not create a new Spree::PromotionCode' do
116
- expect { subject }.not_to change { Spree::PromotionCode.all.size }
117
- end
118
- end
119
-
120
- context 'associated with another promotion' do
121
- let!(:existing_promotion_code) { create(:promotion_code, value: 'just an old promo code') }
122
-
123
- it 'raises an exception' do
124
- expect { subject }.to raise_error(StandardError)
125
- end
126
- end
127
- end
128
- end
129
-
130
- context 'to Solidus::Migrations::PromotionWithCodeHandlers::DoNothing' do
131
- let(:promotions_with_code_handler) { Solidus::Migrations::PromotionWithCodeHandlers::DoNothing }
132
-
133
- it 'just prints a message' do
134
- migration_context = double('a migration context')
135
- allow_any_instance_of(promotions_with_code_handler)
136
- .to receive(:migration_context)
137
- .and_return(migration_context)
138
-
139
- expect(migration_context)
140
- .to receive(:say)
141
- .with("Code 'Just An Old Promo Code' is going to be removed from Spree::Promotion with id '#{promotion_with_code.id}'")
142
-
143
- subject
144
- end
145
- end
146
- end
147
- end
148
- end