active_shipping 2.0.0 → 2.0.1

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: 8daef7547a1eadf200bb06247f518cc9e5813a31
4
- data.tar.gz: ea7675b5b350fdf8ea1372e87f22b3efcb99f74f
3
+ metadata.gz: '049d76632467f43502625eb1059dcc9db84009ff'
4
+ data.tar.gz: 2067401f05fcdad7fd6fd1b6bb14eb06dd08d90b
5
5
  SHA512:
6
- metadata.gz: a2b9295a91d1a7af45debd3c659588b9e3f86fb212d266c58d4274a60db07f760ff0833dd01795ad69449bceafb3de154dcef1999c80c8bd26df753292f45c45
7
- data.tar.gz: c1390c553d52b92720f7219ce72ee8f68589361b342346a8b88b2b616c1b668931472c17d816aeb4c74c91e35394e5c355b2428679d492d32d2969da1e08db5d
6
+ metadata.gz: 7240de267d12ccfeef56c846b4869f244ef2d9fc4094fb28ed560431f1815c9e0ad4840a03ea56fd25df8d1af28a82425dbfed332ebe4f2d1544572b00e1e209
7
+ data.tar.gz: 5520de3c6a87772b29241fe241a7a142d188f36e27de5ae6228ea83d83a61b6278cb468a371513ce7d05087795f59b1bdfe385a32478c2c4f904b3ef947105a5
@@ -1,5 +1,8 @@
1
1
  # ActiveShipping CHANGELOG
2
2
 
3
+ ### v2.0.1
4
+ - Raise ActiveShipping::ResponseError error in favour of ActiveUtils::ResponseError for CanadaPostPWS#find_shipment_receipt
5
+
3
6
  ### v2.0.0
4
7
  - Drop support for < ruby 2.2, support ruby 2.4
5
8
  - Drop support for < Rails 4.2.
@@ -115,6 +115,8 @@ module ActiveShipping
115
115
  def find_shipment_receipt(shipping_id, options = {})
116
116
  response = ssl_get(shipment_receipt_url(shipping_id, options), headers(options, SHIPMENT_MIMETYPE, SHIPMENT_MIMETYPE))
117
117
  parse_shipment_receipt_response(response)
118
+ rescue ActiveUtils::ResponseError => e
119
+ raise ActiveShipping::ResponseError.new(e.message)
118
120
  end
119
121
 
120
122
  def retrieve_shipping_label(shipping_response, options = {})
@@ -1,3 +1,3 @@
1
1
  module ActiveShipping
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
@@ -229,6 +229,16 @@ class CanadaPostPwsShippingTest < ActiveSupport::TestCase
229
229
  assert_equal @cp.parse_shipment_receipt_response(xml_response), response
230
230
  end
231
231
 
232
+ def test_find_shipment_receipt_returns_active_shipping_response_error_if_active_utils_response_error
233
+ options = @default_options.dup
234
+ bad_response = Net::HTTPResponse.new({}, 404, "404 Not Found")
235
+ response_error = ActiveUtils::ResponseError.new(bad_response)
236
+ @cp.expects(:ssl_get).once.raises(response_error)
237
+ assert_raises ActiveShipping::ResponseError do
238
+ response = @cp.find_shipment_receipt('1234567', options)
239
+ end
240
+ end
241
+
232
242
  def test_character_limit_on_customs_description
233
243
  @line_item1.first.stubs(:name).returns("Some super long description that exceeds the 44 character limit")
234
244
  options = @default_options.dup
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: 2.0.0
4
+ version: 2.0.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-05-30 00:00:00.000000000 Z
11
+ date: 2017-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: measured