active_shipping 1.13.0 → 1.13.1
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 +4 -4
- data/lib/active_shipping/carriers/ups.rb +1 -0
- data/lib/active_shipping/version.rb +1 -1
- data/test/fixtures/xml/ups/location_node_kosovo_kv.xml +7 -0
- data/test/fixtures/xml/ups/location_node_kosovo_xk.xml +7 -0
- data/test/fixtures/xml/ups/location_node_zz.xml +7 -0
- data/test/unit/carriers/ups_test.rb +24 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd54ce58b97bec268d53f643acfc848c80c74ca5
|
4
|
+
data.tar.gz: f8a1e7ffb41dc0f718f6b2572a47229297892e06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a5a1cd82b023673f623358d33cbcfb9837847f0514459210746d62912aa5c45cf3fc67eb2760c64cad7c5e3960699342ca7088aef9636f57232da7c5c3f51f5
|
7
|
+
data.tar.gz: 4e21734a33afa3e6f077767328ea6f277ee366e376dfd8b1c719b746ec14b1d357a2ae01243485381653c44144442992f23a8af71a765f87322937983032cd09
|
@@ -1078,6 +1078,7 @@ module ActiveShipping
|
|
1078
1078
|
return nil unless address
|
1079
1079
|
country = address.at('CountryCode').try(:text)
|
1080
1080
|
country = 'US' if country == 'ZZ' # Sometimes returned by SUREPOST in the US
|
1081
|
+
country = 'XK' if country == 'KV' # ActiveUtils now refers to Kosovo by XK
|
1081
1082
|
Location.new(
|
1082
1083
|
:country => country,
|
1083
1084
|
:postal_code => address.at('PostalCode').try(:text),
|
@@ -173,6 +173,30 @@ class UPSTest < Minitest::Test
|
|
173
173
|
assert_empty response.shipment_events
|
174
174
|
end
|
175
175
|
|
176
|
+
def test_location_from_address_node_kosovo_kv
|
177
|
+
address = Nokogiri::XML::DocumentFragment.parse(xml_fixture('ups/location_node_kosovo_kv'))
|
178
|
+
|
179
|
+
parsed = @carrier.send(:location_from_address_node, address)
|
180
|
+
assert_equal 'XK', parsed.country_code
|
181
|
+
assert_equal 'Kosovo', parsed.country.name
|
182
|
+
end
|
183
|
+
|
184
|
+
def test_location_from_address_node_kosovo_xk
|
185
|
+
address = Nokogiri::XML::DocumentFragment.parse(xml_fixture('ups/location_node_kosovo_xk'))
|
186
|
+
|
187
|
+
parsed = @carrier.send(:location_from_address_node, address)
|
188
|
+
assert_equal 'XK', parsed.country_code
|
189
|
+
assert_equal 'Kosovo', parsed.country.name
|
190
|
+
end
|
191
|
+
|
192
|
+
def test_location_from_address_node_zz
|
193
|
+
address = Nokogiri::XML::DocumentFragment.parse(xml_fixture('ups/location_node_zz'))
|
194
|
+
|
195
|
+
parsed = @carrier.send(:location_from_address_node, address)
|
196
|
+
assert_equal 'US', parsed.country_code
|
197
|
+
assert_equal 'United States', parsed.country.name
|
198
|
+
end
|
199
|
+
|
176
200
|
def test_response_parsing_an_oversize_package
|
177
201
|
mock_response = xml_fixture('ups/package_exceeds_maximum_length')
|
178
202
|
@carrier.expects(:commit).returns(mock_response)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_shipping
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.13.
|
4
|
+
version: 1.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: quantified
|
@@ -339,6 +339,9 @@ files:
|
|
339
339
|
- test/fixtures/xml/ups/delivery_dates_response.xml
|
340
340
|
- test/fixtures/xml/ups/example_tracking_response.xml
|
341
341
|
- test/fixtures/xml/ups/in_transit_shipment.xml
|
342
|
+
- test/fixtures/xml/ups/location_node_kosovo_kv.xml
|
343
|
+
- test/fixtures/xml/ups/location_node_kosovo_xk.xml
|
344
|
+
- test/fixtures/xml/ups/location_node_zz.xml
|
342
345
|
- test/fixtures/xml/ups/no_negotiated_rates.xml
|
343
346
|
- test/fixtures/xml/ups/no_shipment_warnings.xml
|
344
347
|
- test/fixtures/xml/ups/no_status_node_success.xml
|
@@ -570,6 +573,9 @@ test_files:
|
|
570
573
|
- test/fixtures/xml/ups/delivery_dates_response.xml
|
571
574
|
- test/fixtures/xml/ups/example_tracking_response.xml
|
572
575
|
- test/fixtures/xml/ups/in_transit_shipment.xml
|
576
|
+
- test/fixtures/xml/ups/location_node_kosovo_kv.xml
|
577
|
+
- test/fixtures/xml/ups/location_node_kosovo_xk.xml
|
578
|
+
- test/fixtures/xml/ups/location_node_zz.xml
|
573
579
|
- test/fixtures/xml/ups/no_negotiated_rates.xml
|
574
580
|
- test/fixtures/xml/ups/no_shipment_warnings.xml
|
575
581
|
- test/fixtures/xml/ups/no_status_node_success.xml
|