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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e38b1f2643ba2b428af9627fe62638a4d4ced137
4
- data.tar.gz: c42f3de2612e17488e8c2ed69991d84297dd8791
3
+ metadata.gz: 1135f7f33aa9294d388558606f3c8254922754b3
4
+ data.tar.gz: 9af9fd3e964b4039447ca04746d85f30e8ea8675
5
5
  SHA512:
6
- metadata.gz: e0cb3a47d17bffddd2a54f8d82e569dd7caa95e9822a44361b33a26a96c903aaa2dda812748556dbc49bded142a45fe8fac58b2db731fd6b568a0fffb078d745
7
- data.tar.gz: ac743371aa813bdbb2f880627b983a900d5fea53abb2a0c02787d014f1558bbd9eac929e01fa9e3bd03af34f9000547b2687757e707a2b10ef8420d92e039a19
6
+ metadata.gz: ecec436c0d80f5d2a11e0baa4274adb28d91412d23643d0c44772665a9875c258070de1d2b68fc5584e06b24d6ca1bdfa5c0512863f74a8b4383f97427d96b07
7
+ data.tar.gz: 7d963a5f838344b627cf26758de42e5363dad9d2873a698c43d96942acc1bc650f45b11bf8ee8c46056ac845470c9bba4c360962de927cc2b27902f12e889b2c
@@ -1,5 +1,9 @@
1
1
  # ActiveShipping CHANGELOG
2
2
 
3
+ ### v1.8.2
4
+ - Add option for FedEx label format
5
+ - Fix kunaki remote tests broken due to more shipping options
6
+
3
7
  ### v1.6.1
4
8
  - Fix FedEx ShipmentEvents to include event type
5
9
  - Skip broken Canada Post remote tests
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module ActiveShipping
2
- VERSION = "1.8.1"
2
+ VERSION = "1.8.2"
3
3
  end
@@ -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
@@ -19,8 +19,8 @@ class RemoteKunakiTest < Minitest::Test
19
19
  )
20
20
 
21
21
  assert response.success?
22
- assert_equal 3, response.rates.size
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.1
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-07-19 00:00:00.000000000 Z
14
+ date: 2016-08-04 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: quantified