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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1fd6c7d9c3034275ed5d1256c1b96d86f909be32
4
- data.tar.gz: 649f6a67c3161c234757a340238445e74a729e23
3
+ metadata.gz: dd54ce58b97bec268d53f643acfc848c80c74ca5
4
+ data.tar.gz: f8a1e7ffb41dc0f718f6b2572a47229297892e06
5
5
  SHA512:
6
- metadata.gz: 510db67fcf7f0c7f49d0d79b385920719d766bff67fc234793209e68a2d0b2f04f8de73aa61a83e8d1df095358346759af8996741418f1cab879f76a5a195322
7
- data.tar.gz: 0da3ec56e0d924538c1afd526190718ad5fdf306f0a91c1fb87e141a3815442bbd07fdf0054bc912bfd78ff0874fe9e12e9b83bd3fc20c7018c2f3cb51c359af
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),
@@ -1,3 +1,3 @@
1
1
  module ActiveShipping
2
- VERSION = "1.13.0"
2
+ VERSION = "1.13.1"
3
3
  end
@@ -0,0 +1,7 @@
1
+ <Address>
2
+ <AddressLine1>123 KOSOVO ST</AddressLine1>
3
+ <City>PRIZRENI</City>
4
+ <StateProvinceCode></StateProvinceCode>
5
+ <PostalCode></PostalCode>
6
+ <CountryCode>KV</CountryCode>
7
+ </Address>
@@ -0,0 +1,7 @@
1
+ <Address>
2
+ <AddressLine1>123 KOSOVO ST</AddressLine1>
3
+ <City>PRIZRENI</City>
4
+ <StateProvinceCode></StateProvinceCode>
5
+ <PostalCode></PostalCode>
6
+ <CountryCode>XK</CountryCode>
7
+ </Address>
@@ -0,0 +1,7 @@
1
+ <Address>
2
+ <AddressLine1>175 AMBASSADOR</AddressLine1>
3
+ <City>NAPERVILLE</City>
4
+ <StateProvinceCode>IL</StateProvinceCode>
5
+ <PostalCode>60540 3920</PostalCode>
6
+ <CountryCode>ZZ</CountryCode>
7
+ </Address>
@@ -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.0
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-16 00:00:00.000000000 Z
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