solidus_core 1.2.0.rc1 → 1.2.0.rc2
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/app_configuration.rb +1 -2
- data/lib/spree/core.rb +1 -0
- data/lib/spree/core/stock_configuration.rb +7 -6
- data/lib/spree/core/version.rb +1 -1
- data/spec/lib/spree/core/stock_configuration_spec.rb +14 -9
- data/spec/models/spree/app_configuration_spec.rb +1 -1
- data/spec/models/spree/shipment_spec.rb +1 -1
- data/spec/models/spree/stock/coordinator_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82876c2eaf3d0b1300b8c2d0903d872a5e214d0a
|
4
|
+
data.tar.gz: efacf0ca0cc2faa62b4e67082a2633505640fec9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 011b1113b9957d987204f53c39658fe8cbb33b9b2de60c96034b7fcac038a209a0b8df568b13d77b5866e2d76691ff44f9cb693957ebe792e738cc7aaab51118
|
7
|
+
data.tar.gz: 2256f27042f878a46bc89cea319e8cec4359a085d82b50ab27a406fcbbc96237b199818e046bd3ff16e24ddee2df805c3e74ac94e98f58302a69d8de9ddd3e94
|
@@ -17,7 +17,6 @@
|
|
17
17
|
#
|
18
18
|
require "spree/core/search/base"
|
19
19
|
require "spree/core/search/variant"
|
20
|
-
require 'spree/core/stock_configuration'
|
21
20
|
|
22
21
|
module Spree
|
23
22
|
class AppConfiguration < Preferences::Configuration
|
@@ -313,7 +312,7 @@ module Spree
|
|
313
312
|
end
|
314
313
|
|
315
314
|
def stock
|
316
|
-
Spree::StockConfiguration
|
315
|
+
@stock_configuration ||= Spree::Core::StockConfiguration.new
|
317
316
|
end
|
318
317
|
|
319
318
|
# all the following can be deprecated when store prefs are no longer supported
|
data/lib/spree/core.rb
CHANGED
@@ -92,6 +92,7 @@ require 'spree/core/controller_helpers/store'
|
|
92
92
|
require 'spree/core/controller_helpers/strong_parameters'
|
93
93
|
require 'spree/core/unreturned_item_charger'
|
94
94
|
require 'spree/core/role_configuration'
|
95
|
+
require 'spree/core/stock_configuration'
|
95
96
|
require 'spree/permission_sets'
|
96
97
|
require 'spree/deprecation'
|
97
98
|
|
@@ -1,11 +1,12 @@
|
|
1
1
|
module Spree
|
2
|
-
module
|
3
|
-
|
4
|
-
|
5
|
-
end
|
2
|
+
module Core
|
3
|
+
class StockConfiguration
|
4
|
+
attr_writer :estimator_class
|
6
5
|
|
7
|
-
|
8
|
-
|
6
|
+
def estimator_class
|
7
|
+
@estimator_class ||= '::Spree::Stock::Estimator'
|
8
|
+
@estimator_class.constantize
|
9
|
+
end
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
data/lib/spree/core/version.rb
CHANGED
@@ -1,16 +1,21 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
RSpec.describe Spree::StockConfiguration do
|
4
|
-
|
5
|
-
|
3
|
+
RSpec.describe Spree::Core::StockConfiguration do
|
4
|
+
describe '#estimator_class' do
|
5
|
+
let(:stock_configuration) { described_class.new }
|
6
|
+
subject { stock_configuration.estimator_class }
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
8
|
+
it "returns Spree::Stock::Estimator" do
|
9
|
+
is_expected.to be ::Spree::Stock::Estimator
|
10
|
+
end
|
10
11
|
|
11
|
-
|
12
|
-
|
12
|
+
context "with another constant name assiged" do
|
13
|
+
MyEstimator = Class.new
|
14
|
+
before { stock_configuration.estimator_class = MyEstimator.to_s }
|
13
15
|
|
14
|
-
|
16
|
+
it "returns the constant" do
|
17
|
+
is_expected.to be MyEstimator
|
18
|
+
end
|
19
|
+
end
|
15
20
|
end
|
16
21
|
end
|
@@ -208,7 +208,7 @@ describe Spree::Shipment, type: :model do
|
|
208
208
|
end
|
209
209
|
|
210
210
|
it 'uses the pluggable estimator class' do
|
211
|
-
expect(Spree::
|
211
|
+
expect(Spree::Config.stock).to receive(:estimator_class).and_call_original
|
212
212
|
shipment.refresh_rates
|
213
213
|
end
|
214
214
|
|
@@ -18,7 +18,7 @@ module Spree
|
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'uses the pluggable estimator class' do
|
21
|
-
expect(Spree::
|
21
|
+
expect(Spree::Config.stock).to receive(:estimator_class).and_call_original
|
22
22
|
subject.packages
|
23
23
|
end
|
24
24
|
end
|
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: 1.2.0.
|
4
|
+
version: 1.2.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|