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

Commit

Permalink
Browse files Browse the repository at this point in the history
Save description for UPS shipment event in message
  • Loading branch information
Jonathan Kwok committed Apr 27, 2016
1 parent 18334c2 commit ef4d734
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_shipping/carriers/ups.rb
Expand Up @@ -850,7 +850,7 @@ def parse_tracking_response(response, options = {})
type_code = activity.at('Status/StatusType/Code').text
zoneless_time = parse_ups_datetime(:time => activity.at('Time'), :date => activity.at('Date'))
location = location_from_address_node(activity.at('ActivityLocation/Address'))
ShipmentEvent.new(description, zoneless_time, location, nil, type_code)
ShipmentEvent.new(description, zoneless_time, location, description, type_code)
end

shipment_events = shipment_events.sort_by(&:time)
Expand Down
13 changes: 13 additions & 0 deletions test/unit/carriers/ups_test.rb
Expand Up @@ -128,6 +128,19 @@ def test_find_tracking_info_should_have_correct_names_for_shipment_events
"DELIVERED"], response.shipment_events.map(&:name)
end

def test_find_tracking_info_should_have_messages_for_shipment_events
@carrier.expects(:commit).returns(@tracking_response)
response = @carrier.find_tracking_info('1Z5FX0076803466397')
assert_equal ["BILLING INFORMATION RECEIVED",
"IMPORT SCAN",
"LOCATION SCAN",
"LOCATION SCAN",
"DEPARTURE SCAN",
"ARRIVAL SCAN",
"OUT FOR DELIVERY",
"DELIVERED"], response.shipment_events.map(&:message)
end

def test_find_tracking_info_should_have_correct_type_codes_for_shipment_events
@carrier.expects(:commit).returns(@tracking_response)
response = @carrier.find_tracking_info('1Z5FX0076803466397')
Expand Down

0 comments on commit ef4d734

Please sign in to comment.