spree_core 3.1.0.rc3 → 3.1.0.rc4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7332a65fecf422eca443206a5ac81db7673245b5
4
- data.tar.gz: 3998319e6c69fa2e2a60fac23a763c6edbd55110
3
+ metadata.gz: 4cb7bbd6bde30953cc5391ee02b054f23ca0b9b9
4
+ data.tar.gz: b9824021ae30dabf0f658a412bdcb8b37a76ebbd
5
5
  SHA512:
6
- metadata.gz: 2918da963fa83b604b0605d7ff8e68359a348df533fe9775474a2c5793d70f27aa27ec405190e47b62a9d90d23040d5f7603f7f3f8d006e87c3c99e23ec636c1
7
- data.tar.gz: 9ffb99aa4ac936e7a1fbe994700c595a6f92f128039e8765e7e56f700920a697bbf1c59eb1b7ec1e9c64cef9e91c34f38ca6d72d3a779793cc8717609a5818f0
6
+ metadata.gz: e993ddd8cd1329cf5a7925c4cea0ac14a33c7a8cabc75b2ee6c0793502e4d8d759e2f94a92d4c100c34ef6408ff073f9df5205df23356afdbb2249a9e548edf6
7
+ data.tar.gz: c7f741a6505e5d5c15ff12f08afdc137aa8b3f8cfde04541b834e6bcb782a750257ac2463c2da5d74994fc8abf194d9683867fbb7bd8dba9875a9555ee1ec614
@@ -3,8 +3,8 @@ require 'spree/order/checkout'
3
3
 
4
4
  module Spree
5
5
  class Order < Spree::Base
6
- PAYMENT_STATES = %w(balance_due credit_owed failed paid void).freeze
7
- SHIPMENT_STATES = %w(backorder canceled partial pending ready shipped).freeze
6
+ PAYMENT_STATES = %w(balance_due credit_owed failed paid void)
7
+ SHIPMENT_STATES = %w(backorder canceled partial pending ready shipped)
8
8
 
9
9
  extend FriendlyId
10
10
  friendly_id :number, slug_column: :number, use: :slugged
@@ -20,6 +20,7 @@ module Spree
20
20
  update_payment_state
21
21
  update_shipments
22
22
  update_shipment_state
23
+ update_shipment_total
23
24
  end
24
25
  run_hooks
25
26
  persist_totals
@@ -21,6 +21,7 @@ module Spree
21
21
 
22
22
  after_save :conditional_variant_touch, if: :changed?
23
23
  after_touch { variant.touch }
24
+ after_destroy { variant.touch }
24
25
 
25
26
  self.whitelisted_ransackable_attributes = ['count_on_hand', 'stock_location_id']
26
27
  self.whitelisted_ransackable_associations = ['variant']
@@ -439,6 +439,7 @@ en:
439
439
  address: Address
440
440
  address1: Address
441
441
  address2: Address (contd.)
442
+ addresses: Addresses
442
443
  adjustable: Adjustable
443
444
  adjustment: Adjustment
444
445
  adjustment_amount: Amount
@@ -1352,7 +1353,7 @@ en:
1352
1353
  apply: Apply Store Credit
1353
1354
  applicable_amount: "%{amount} in store credit will be applied to this order."
1354
1355
  available_amount: "You have %{amount} in Store Credit available!"
1355
- remaining_amount: "You have %{amount} remaining in your account\'s Store Credit."
1356
+ remaining_amount: "You have %{amount} remaining in your account's Store Credit."
1356
1357
  additional_payment_needed: Select another payment method for the remaining %{amount}.
1357
1358
  errors:
1358
1359
  cannot_change_used_store_credit: You cannot change a store credit that has already been used
@@ -1393,6 +1394,8 @@ en:
1393
1394
  taxon: Taxon
1394
1395
  taxon_edit: Edit Taxon
1395
1396
  taxon_placeholder: Add a Taxon
1397
+ tags: Tags
1398
+ tags_placeholder: Add Tags
1396
1399
  taxon_rule:
1397
1400
  choose_taxons: Choose taxons
1398
1401
  label: Order must contain x amount of these taxons
@@ -115,6 +115,12 @@ module Spree
115
115
  end
116
116
 
117
117
  config.to_prepare do
118
+ # Load spree locales before decorators
119
+ I18n.load_path += Dir.glob(
120
+ File.join(
121
+ File.dirname(__FILE__), '../../../config/locales', '*.{rb,yml}'
122
+ )
123
+ )
118
124
  # Load application's model / class decorators
119
125
  Dir.glob(File.join(File.dirname(__FILE__), '../../../app/**/*_decorator*.rb')) do |c|
120
126
  Rails.configuration.cache_classes ? require(c) : load(c)
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- "3.1.0.rc3"
3
+ "3.1.0.rc4"
4
4
  end
5
5
  end
@@ -210,45 +210,56 @@ module Spree
210
210
  context "completed order" do
211
211
  before { allow(order).to receive_messages completed?: true }
212
212
 
213
- it "updates payment state" do
214
- expect(updater).to receive(:update_payment_state)
215
- updater.update
216
- end
217
-
218
- it "updates shipment state" do
219
- expect(updater).to receive(:update_shipment_state)
220
- updater.update
221
- end
213
+ describe "#update" do
214
+ it "updates payment state" do
215
+ expect(updater).to receive(:update_payment_state)
216
+ updater.update
217
+ end
222
218
 
223
- it "updates each shipment" do
224
- shipment = stub_model(Spree::Shipment, order: order)
225
- shipments = [shipment]
226
- allow(order).to receive_messages shipments: shipments
227
- allow(shipments).to receive_messages states: []
228
- allow(shipments).to receive_messages ready: []
229
- allow(shipments).to receive_messages pending: []
230
- allow(shipments).to receive_messages shipped: []
219
+ it "updates shipment state" do
220
+ expect(updater).to receive(:update_shipment_state)
221
+ updater.update
222
+ end
231
223
 
232
- expect(shipment).to receive(:update!).with(order)
233
- updater.update_shipments
224
+ it "updates shipments total again after updating shipments" do
225
+ expect(updater).to receive(:update_shipment_total).ordered
226
+ expect(updater).to receive(:update_shipments).ordered
227
+ expect(updater).to receive(:update_shipment_total).ordered
228
+ updater.update
229
+ end
234
230
  end
235
231
 
236
- it "refreshes shipment rates" do
237
- shipment = stub_model(Spree::Shipment, order: order)
238
- shipments = [shipment]
239
- allow(order).to receive_messages shipments: shipments
232
+ describe "#update_shipments" do
233
+ it "updates each shipment" do
234
+ shipment = stub_model(Spree::Shipment, order: order)
235
+ shipments = [shipment]
236
+ allow(order).to receive_messages shipments: shipments
237
+ allow(shipments).to receive_messages states: []
238
+ allow(shipments).to receive_messages ready: []
239
+ allow(shipments).to receive_messages pending: []
240
+ allow(shipments).to receive_messages shipped: []
241
+
242
+ expect(shipment).to receive(:update!).with(order)
243
+ updater.update_shipments
244
+ end
240
245
 
241
- expect(shipment).to receive(:refresh_rates)
242
- updater.update_shipments
243
- end
246
+ it "refreshes shipment rates" do
247
+ shipment = stub_model(Spree::Shipment, order: order)
248
+ shipments = [shipment]
249
+ allow(order).to receive_messages shipments: shipments
244
250
 
245
- it "updates the shipment amount" do
246
- shipment = stub_model(Spree::Shipment, order: order)
247
- shipments = [shipment]
248
- allow(order).to receive_messages shipments: shipments
251
+ expect(shipment).to receive(:refresh_rates)
252
+ updater.update_shipments
253
+ end
254
+
255
+ it "updates the shipment amount" do
256
+ shipment = stub_model(Spree::Shipment, order: order)
257
+ shipments = [shipment]
258
+ allow(order).to receive_messages shipments: shipments
249
259
 
250
- expect(shipment).to receive(:update_amounts)
251
- updater.update_shipments
260
+ expect(shipment).to receive(:update_amounts)
261
+ updater.update_shipments
262
+ end
252
263
  end
253
264
  end
254
265
 
data/spree_core.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.files = `git ls-files`.split("\n")
20
20
  s.require_path = 'lib'
21
21
 
22
- s.add_dependency 'activemerchant', '~> 1.47.0'
22
+ s.add_dependency 'activemerchant', '~> 1.49.0'
23
23
  s.add_dependency 'acts_as_list', '0.7.2'
24
24
  s.add_dependency 'awesome_nested_set', '~> 3.0.1'
25
25
  s.add_dependency 'carmen', '~> 1.0.0'
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
29
29
  s.add_dependency 'font-awesome-rails', '~> 4.0'
30
30
  s.add_dependency 'friendly_id', '~> 5.1.0'
31
31
  s.add_dependency 'highline', '~> 1.6.18' # Necessary for the install generator
32
- s.add_dependency 'kaminari', '~> 0.15', '>= 0.15.1'
32
+ s.add_dependency 'kaminari', '~> 0.17'
33
33
  s.add_dependency 'monetize', '~> 1.1'
34
34
  s.add_dependency 'paperclip', '~> 4.3.0'
35
35
  s.add_dependency 'paranoia', '~> 2.1.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.rc3
4
+ version: 3.1.0.rc4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-12 00:00:00.000000000 Z
11
+ date: 2016-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.47.0
19
+ version: 1.49.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.47.0
26
+ version: 1.49.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: acts_as_list
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -156,20 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '0.15'
160
- - - ">="
161
- - !ruby/object:Gem::Version
162
- version: 0.15.1
159
+ version: '0.17'
163
160
  type: :runtime
164
161
  prerelease: false
165
162
  version_requirements: !ruby/object:Gem::Requirement
166
163
  requirements:
167
164
  - - "~>"
168
165
  - !ruby/object:Gem::Version
169
- version: '0.15'
170
- - - ">="
171
- - !ruby/object:Gem::Version
172
- version: 0.15.1
166
+ version: '0.17'
173
167
  - !ruby/object:Gem::Dependency
174
168
  name: monetize
175
169
  requirement: !ruby/object:Gem::Requirement