spree_api 2.0.10 → 2.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/spree/order_decorator.rb +3 -2
- data/spec/models/spree/order_spec.rb +14 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 987159d621ff7cfdfcdc8fa4db6738e78bb4e4a2
|
4
|
+
data.tar.gz: 44a7a0ec5aff3f2f2b0cbf3a978e47ebe612f742
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3aebbf513040a6f75ab4f4d76b2d5c35adf90ad1e44b9bc1d37b1103343945ea036fab9465e9874bdcd258d7d93d5e443d4dfd7f37443594382b4684b0b5cb9
|
7
|
+
data.tar.gz: 3af0f7bfb8acc3d11734ac2123216840f1cd733b3207c4152926e62f9274819e774c56afeffa64fc64d8f7a7164aecce1f85f57a8df6904914f9bbe74c51370e
|
@@ -64,8 +64,9 @@ Spree::Order.class_eval do
|
|
64
64
|
shipment.save!
|
65
65
|
|
66
66
|
shipping_method = Spree::ShippingMethod.find_by_name!(s[:shipping_method])
|
67
|
-
shipment.shipping_rates.create!(:shipping_method => shipping_method,
|
68
|
-
|
67
|
+
rate = shipment.shipping_rates.create!(:shipping_method => shipping_method,
|
68
|
+
:cost => s[:cost])
|
69
|
+
shipment.selected_shipping_rate_id = rate.id
|
69
70
|
rescue Exception => e
|
70
71
|
raise "Order import shipments: #{e.message} #{s}"
|
71
72
|
end
|
@@ -231,8 +231,20 @@ module Spree
|
|
231
231
|
shipment = order.shipments.first
|
232
232
|
shipment.inventory_units.first.variant_id.should eq product.master.id
|
233
233
|
shipment.tracking.should eq '123456789'
|
234
|
-
|
235
|
-
|
234
|
+
rate = shipment.selected_shipping_rate
|
235
|
+
rate.shipping_method.name.should == shipping_method.name
|
236
|
+
rate.cost.should == 4.99
|
237
|
+
end
|
238
|
+
|
239
|
+
it 'handles shipment building exceptions' do
|
240
|
+
params = { :shipments_attributes => [{ :tracking => '123456789',
|
241
|
+
:cost => '4.99',
|
242
|
+
:shipping_method => 'XXX',
|
243
|
+
:inventory_units => [{ :sku => sku }]
|
244
|
+
}] }
|
245
|
+
expect {
|
246
|
+
order = Order.build_from_api(user, params)
|
247
|
+
}.to raise_error /XXX/
|
236
248
|
end
|
237
249
|
|
238
250
|
it "raises if cant find stock location" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Bigg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.0.
|
19
|
+
version: 2.0.11
|
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: 2.0.
|
26
|
+
version: 2.0.11
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rabl
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
246
246
|
version: '0'
|
247
247
|
requirements: []
|
248
248
|
rubyforge_project:
|
249
|
-
rubygems_version: 2.2.
|
249
|
+
rubygems_version: 2.2.0
|
250
250
|
signing_key:
|
251
251
|
specification_version: 4
|
252
252
|
summary: Spree's API
|