Skip to content
This repository was archived by the owner on Jun 13, 2018. It is now read-only.

Commit 85ae7b5

Browse files
author
Jonathan Kwok
committed
Merge pull request #359 from Shopify/non-nil-ups-event-messages
Save description for UPS shipment event in message
2 parents 6fe6dea + ef4d734 commit 85ae7b5

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/active_shipping/carriers/ups.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ def parse_tracking_response(response, options = {})
850850
type_code = activity.at('Status/StatusType/Code').text
851851
zoneless_time = parse_ups_datetime(:time => activity.at('Time'), :date => activity.at('Date'))
852852
location = location_from_address_node(activity.at('ActivityLocation/Address'))
853-
ShipmentEvent.new(description, zoneless_time, location, nil, type_code)
853+
ShipmentEvent.new(description, zoneless_time, location, description, type_code)
854854
end
855855

856856
shipment_events = shipment_events.sort_by(&:time)

test/unit/carriers/ups_test.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,19 @@ def test_find_tracking_info_should_have_correct_names_for_shipment_events
128128
"DELIVERED"], response.shipment_events.map(&:name)
129129
end
130130

131+
def test_find_tracking_info_should_have_messages_for_shipment_events
132+
@carrier.expects(:commit).returns(@tracking_response)
133+
response = @carrier.find_tracking_info('1Z5FX0076803466397')
134+
assert_equal ["BILLING INFORMATION RECEIVED",
135+
"IMPORT SCAN",
136+
"LOCATION SCAN",
137+
"LOCATION SCAN",
138+
"DEPARTURE SCAN",
139+
"ARRIVAL SCAN",
140+
"OUT FOR DELIVERY",
141+
"DELIVERED"], response.shipment_events.map(&:message)
142+
end
143+
131144
def test_find_tracking_info_should_have_correct_type_codes_for_shipment_events
132145
@carrier.expects(:commit).returns(@tracking_response)
133146
response = @carrier.find_tracking_info('1Z5FX0076803466397')

0 commit comments

Comments
 (0)