active_shipping 1.8.1 → 1.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/active_shipping/carriers/fedex.rb +4 -1
- data/lib/active_shipping/version.rb +1 -1
- data/test/remote/fedex_test.rb +16 -0
- data/test/remote/kunaki_test.rb +2 -2
- data/test/unit/carriers/fedex_test.rb +11 -0
- 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: 1135f7f33aa9294d388558606f3c8254922754b3
|
4
|
+
data.tar.gz: 9af9fd3e964b4039447ca04746d85f30e8ea8675
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecec436c0d80f5d2a11e0baa4274adb28d91412d23643d0c44772665a9875c258070de1d2b68fc5584e06b24d6ca1bdfa5c0512863f74a8b4383f97427d96b07
|
7
|
+
data.tar.gz: 7d963a5f838344b627cf26758de42e5363dad9d2873a698c43d96942acc1bc650f45b11bf8ee8c46056ac845470c9bba4c360962de927cc2b27902f12e889b2c
|
data/CHANGELOG.md
CHANGED
@@ -136,6 +136,9 @@ module ActiveShipping
|
|
136
136
|
|
137
137
|
DEFAULT_LABEL_STOCK_TYPE = 'PAPER_7X4.75'
|
138
138
|
|
139
|
+
# Available return formats for image data when creating labels
|
140
|
+
LABEL_FORMATS = ['DPL', 'EPL2', 'PDF', 'ZPLII', 'PNG']
|
141
|
+
|
139
142
|
def self.service_name_for_code(service_code)
|
140
143
|
SERVICE_TYPES[service_code] || "FedEx #{service_code.titleize.sub(/Fedex /, '')}"
|
141
144
|
end
|
@@ -219,7 +222,7 @@ module ActiveShipping
|
|
219
222
|
|
220
223
|
xml.LabelSpecification do
|
221
224
|
xml.LabelFormatType('COMMON2D')
|
222
|
-
xml.ImageType('PNG')
|
225
|
+
xml.ImageType(options[:label_format] || 'PNG')
|
223
226
|
xml.LabelStockType(options[:label_stock_type] || DEFAULT_LABEL_STOCK_TYPE)
|
224
227
|
end
|
225
228
|
|
data/test/remote/fedex_test.rb
CHANGED
@@ -379,4 +379,20 @@ class RemoteFedExTest < Minitest::Test
|
|
379
379
|
signature_option = response.params["ProcessShipmentReply"]["CompletedShipmentDetail"]["CompletedPackageDetails"]["SignatureOption"]
|
380
380
|
assert_equal FedEx::SIGNATURE_OPTION_CODES[:adult], signature_option
|
381
381
|
end
|
382
|
+
|
383
|
+
def test_obtain_shipping_label_with_label_format_option
|
384
|
+
response = @carrier.create_shipment(
|
385
|
+
location_fixtures[:beverly_hills_with_name],
|
386
|
+
location_fixtures[:new_york_with_name],
|
387
|
+
package_fixtures[:wii],
|
388
|
+
:test => true,
|
389
|
+
:label_format => 'PDF'
|
390
|
+
)
|
391
|
+
|
392
|
+
assert response.success?
|
393
|
+
refute_empty response.labels
|
394
|
+
data = response.labels.first.img_data
|
395
|
+
refute_empty data
|
396
|
+
assert data[0...4] == '%PDF'
|
397
|
+
end
|
382
398
|
end
|
data/test/remote/kunaki_test.rb
CHANGED
@@ -19,8 +19,8 @@ class RemoteKunakiTest < Minitest::Test
|
|
19
19
|
)
|
20
20
|
|
21
21
|
assert response.success?
|
22
|
-
assert_equal
|
23
|
-
assert_equal ["UPS 2nd Day Air", "UPS Ground", "UPS Next Day Air Saver"], response.rates.collect(&:service_name).sort
|
22
|
+
assert_equal 4, response.rates.size
|
23
|
+
assert_equal ["UPS 2nd Day Air", "UPS Ground", "UPS Next Day Air Saver", "USPS First Class Mail"], response.rates.collect(&:service_name).sort
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_send_no_items
|
@@ -601,6 +601,17 @@ class FedExTest < Minitest::Test
|
|
601
601
|
assert_equal result.search('RequestedPackageLineItems/CustomerReferences/Value').text, "FOO-123"
|
602
602
|
end
|
603
603
|
|
604
|
+
def test_create_shipment_label_format_option
|
605
|
+
packages = package_fixtures.values_at(:chocolate_stuff)
|
606
|
+
result = Nokogiri::XML(@carrier.send(:build_shipment_request,
|
607
|
+
location_fixtures[:beverly_hills],
|
608
|
+
location_fixtures[:annapolis],
|
609
|
+
packages,
|
610
|
+
:label_format => 'ZPLII',
|
611
|
+
:test => true))
|
612
|
+
assert_equal result.search('RequestedShipment/LabelSpecification/ImageType').text, "ZPLII"
|
613
|
+
end
|
614
|
+
|
604
615
|
def test_create_shipment_default_label_stock_type
|
605
616
|
packages = package_fixtures.values_at(:wii)
|
606
617
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_shipping
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James MacAulay
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-
|
14
|
+
date: 2016-08-04 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: quantified
|