test/unit/carriers/ups_test.rb in active_shipping-1.8.3 vs test/unit/carriers/ups_test.rb in active_shipping-1.8.4
- old
+ new
@@ -177,10 +177,17 @@
end
assert_equal "Failure: Package exceeds the maximum length constraint of 108 inches. Length is the longest side of a package.", e.message
end
+ def test_response_parsing_an_undecoded_character
+ unencoded_response = @tracking_response.gsub('NAPERVILLE', "N\xc4PERVILLE")
+ @carrier.stubs(:ssl_post).returns(unencoded_response)
+ response = @carrier.find_tracking_info('1Z5FX0076803466397')
+ assert_equal 'NÄPERVILLE', response.shipment_events.first.location.city
+ end
+
def test_response_parsing_an_unknown_error
mock_response = '<RatingServiceSelectionResponse><Response><ResponseStatusCode>0</ResponseStatusCode></Response></RatingServiceSelectionResponse>'
@carrier.expects(:commit).returns(mock_response)
e = assert_raises(ActiveShipping::ResponseError) do
@@ -525,10 +532,10 @@
:test => true
}
)
response.delivery_estimates.each do |delivery_estimate|
- assert delivery_estimate.service_name, UPS::DEFAULT_SERVICES[delivery_estimate.service_code]
+ assert_equal delivery_estimate.service_code, UPS::DEFAULT_SERVICE_NAME_TO_CODE[delivery_estimate.service_name]
end
end
def test_get_rates_for_single_serivce
mock_response = xml_fixture("ups/rate_single_service")