active_shipping 2.0.1 → 2.1.0

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: '049d76632467f43502625eb1059dcc9db84009ff'
4
- data.tar.gz: 2067401f05fcdad7fd6fd1b6bb14eb06dd08d90b
3
+ metadata.gz: 9337304484e37d86fe2905321e6739f774094b06
4
+ data.tar.gz: df9e20bc15df77173a6d6e6d3ae2e0c016a5fe41
5
5
  SHA512:
6
- metadata.gz: 7240de267d12ccfeef56c846b4869f244ef2d9fc4094fb28ed560431f1815c9e0ad4840a03ea56fd25df8d1af28a82425dbfed332ebe4f2d1544572b00e1e209
7
- data.tar.gz: 5520de3c6a87772b29241fe241a7a142d188f36e27de5ae6228ea83d83a61b6278cb468a371513ce7d05087795f59b1bdfe385a32478c2c4f904b3ef947105a5
6
+ metadata.gz: 36f4b8d16f48ea3114e6f449ba6d65a06beed8bdc556f72a00664e37030141677cf7a136679c341d98dab2f8fc418bf8788d59b495460a79926b5cfc7984afd1
7
+ data.tar.gz: f97b2cd9167cd0f5bede7dfaf179cc7e584424061b8b101b43c37f525b00f142ceb10f79cf2d31e6d22caaac23282317d6463b691edde60e49537af24850731d
@@ -1,7 +1,7 @@
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
3
+ ### v2.1.0
4
+ - Add email field to Location
5
5
 
6
6
  ### v2.0.0
7
7
  - Drop support for < ruby 2.2, support ruby 2.4
@@ -115,8 +115,6 @@ 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)
120
118
  end
121
119
 
122
120
  def retrieve_shipping_label(shipping_response, options = {})
@@ -13,6 +13,7 @@ module ActiveShipping #:nodoc:
13
13
  address3: [:address3],
14
14
  phone: [:phone, :phone_number],
15
15
  fax: [:fax, :fax_number],
16
+ email: [:email],
16
17
  address_type: [:address_type],
17
18
  company_name: [:company, :company_name],
18
19
  }.freeze
@@ -28,6 +29,7 @@ module ActiveShipping #:nodoc:
28
29
  :address3,
29
30
  :phone,
30
31
  :fax,
32
+ :email,
31
33
  :address_type,
32
34
  :company_name
33
35
 
@@ -54,6 +56,7 @@ module ActiveShipping #:nodoc:
54
56
  @address3 = options[:address3]
55
57
  @phone = options[:phone]
56
58
  @fax = options[:fax]
59
+ @email = options[:email]
57
60
  @company_name = options[:company_name] || options[:company]
58
61
 
59
62
  self.address_type = options[:address_type]
@@ -122,6 +125,7 @@ module ActiveShipping #:nodoc:
122
125
  address3: address3,
123
126
  phone: phone,
124
127
  fax: fax,
128
+ email: email,
125
129
  address_type: address_type,
126
130
  company_name: company_name
127
131
  }
@@ -142,6 +146,7 @@ module ActiveShipping #:nodoc:
142
146
  string = prettyprint
143
147
  string << "\nPhone: #{@phone}" unless @phone.blank?
144
148
  string << "\nFax: #{@fax}" unless @fax.blank?
149
+ string << "\nEmail: #{@email}" unless @email.blank?
145
150
  string
146
151
  end
147
152
 
@@ -1,3 +1,3 @@
1
1
  module ActiveShipping
2
- VERSION = "2.0.1"
2
+ VERSION = "2.1.0"
3
3
  end
@@ -116,7 +116,8 @@ module ActiveShipping::Test
116
116
  :address1 => '110 Laurier Avenue West',
117
117
  :postal_code => 'K1P 1J1',
118
118
  :phone => '1-613-580-2400',
119
- :fax => '1-613-580-2495'),
119
+ :fax => '1-613-580-2495',
120
+ :email => 'bob.bobsen@gmail.com'),
120
121
  :ottawa_with_name => Location.new( :country => 'CA',
121
122
  :province => 'ON',
122
123
  :city => 'Ottawa',
@@ -229,16 +229,6 @@ 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
-
242
232
  def test_character_limit_on_customs_description
243
233
  @line_item1.first.stubs(:name).returns("Some super long description that exceeds the 44 character limit")
244
234
  options = @default_options.dup
@@ -102,7 +102,7 @@ class FedExTest < ActiveSupport::TestCase
102
102
 
103
103
  @carrier.expects(:ship_timestamp).returns(Time.parse("2009-07-20T12:01:55-04:00").in_time_zone('US/Eastern'))
104
104
  @carrier.expects(:commit).with { |request, test_mode| Hash.from_xml(request) == Hash.from_xml(expected_request) && test_mode }.returns(mock_response)
105
- destination = ActiveShipping::Location.from(location_fixtures[:beverly_hills].to_hash)
105
+ destination = ActiveShipping::Location.from(location_fixtures[:beverly_hills].to_hash)
106
106
  @carrier.find_rates( location_fixtures[:ottawa],
107
107
  destination,
108
108
  package_fixtures.values_at(:book, :wii), test: true)
@@ -599,7 +599,7 @@ class FedExTest < ActiveSupport::TestCase
599
599
  end
600
600
 
601
601
  ### create_shipment
602
-
602
+
603
603
  def test_create_shipment
604
604
  confirm_response = xml_fixture('fedex/create_shipment_response')
605
605
  @carrier.stubs(:commit).returns(confirm_response)
@@ -15,6 +15,7 @@ class LocationTest < ActiveSupport::TestCase
15
15
  address: '66 Gregory Ave.',
16
16
  phone: '515-555-1212',
17
17
  fax_number: 'none to speak of',
18
+ email: 'bob.bobsen@gmail.com',
18
19
  address_type: :commercial,
19
20
  name: "Bob Bobsen",
20
21
  }
@@ -35,6 +36,7 @@ class LocationTest < ActiveSupport::TestCase
35
36
  assert_equal @attributes_hash[:address], location.address1
36
37
  assert_equal @attributes_hash[:phone], location.phone
37
38
  assert_equal @attributes_hash[:fax_number], location.fax
39
+ assert_equal @attributes_hash[:email], location.email
38
40
  assert_equal @attributes_hash[:address_type].to_s, location.address_type
39
41
  assert_equal @attributes_hash[:name], location.name
40
42
  end
@@ -62,6 +64,7 @@ class LocationTest < ActiveSupport::TestCase
62
64
  assert_equal @attributes_hash[:address], location.address1
63
65
  assert_equal @attributes_hash[:phone], location.phone
64
66
  assert_equal @attributes_hash[:fax_number], location.fax
67
+ assert_equal @attributes_hash[:email], location.email
65
68
  assert_equal @attributes_hash[:address_type].to_s, location.address_type
66
69
  assert_equal @attributes_hash[:name], location.name
67
70
  end
@@ -116,7 +119,7 @@ class LocationTest < ActiveSupport::TestCase
116
119
  end
117
120
 
118
121
  test "#inspect returns a readable string" do
119
- expected = "110 Laurier Avenue West\nOttawa, ON, K1P 1J1\nCanada\nPhone: 1-613-580-2400\nFax: 1-613-580-2495"
122
+ expected = "110 Laurier Avenue West\nOttawa, ON, K1P 1J1\nCanada\nPhone: 1-613-580-2400\nFax: 1-613-580-2495\nEmail: bob.bobsen@gmail.com"
120
123
  assert_equal expected, @location.inspect
121
124
  end
122
125
 
@@ -165,7 +168,7 @@ class LocationTest < ActiveSupport::TestCase
165
168
  end
166
169
 
167
170
  test "#to_hash has the expected attributes" do
168
- expected = %w(address1 address2 address3 address_type city company_name country fax name phone postal_code province)
171
+ expected = %w(address1 address2 address3 address_type city company_name country email fax name phone postal_code province)
169
172
 
170
173
  assert_equal expected, @location.to_hash.stringify_keys.keys.sort
171
174
  end
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.1
4
+ version: 2.1.0
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-31 00:00:00.000000000 Z
11
+ date: 2017-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: measured