test/remote/ups_test.rb in active_shipping-1.7.0 vs test/remote/ups_test.rb in active_shipping-1.7.1
- old
+ new
@@ -281,11 +281,11 @@
)
assert response.success?
refute_empty response.delivery_estimates
ground_delivery_estimate = response.delivery_estimates.select {|de| de.service_name == "UPS Ground"}.first
- assert_equal Date.parse(1.business_days.from_now.to_s), ground_delivery_estimate.date
+ assert_equal 1.business_days.after(today), ground_delivery_estimate.date
end
def test_delivery_date_estimates_within_zip_with_no_value
today = Date.current
@@ -300,11 +300,11 @@
)
assert response.success?
refute_empty response.delivery_estimates
ground_delivery_estimate = response.delivery_estimates.select {|de| de.service_name == "UPS Ground"}.first
- assert_equal Date.parse(1.business_days.from_now.to_s), ground_delivery_estimate.date
+ assert_equal 1.business_days.after(today), ground_delivery_estimate.date
end
def test_delivery_date_estimates_across_zips
today = Date.current
@@ -319,13 +319,13 @@
)
assert response.success?
refute_empty response.delivery_estimates
ground_delivery_estimate = response.delivery_estimates.select {|de| de.service_name == "UPS Ground"}.first
- assert_equal Date.parse(3.business_days.from_now.to_s), ground_delivery_estimate.date
+ assert_equal 3.business_days.after(today), ground_delivery_estimate.date
next_day_delivery_estimate = response.delivery_estimates.select {|de| de.service_name == "UPS Next Day Air"}.first
- assert_equal Date.parse(1.business_days.from_now.to_s), next_day_delivery_estimate.date
+ assert_equal 1.business_days.after(today), next_day_delivery_estimate.date
end
def test_rate_with_single_service
response = @carrier.find_rates(
location_fixtures[:new_york_with_name],
@@ -450,9 +450,21 @@
response = @carrier.create_shipment(
location_fixtures[:beverly_hills_with_name],
location_fixtures[:new_york_with_name],
package_fixtures.values_at(:frozen_stuff),
:service_code => '01',
+ :test => true
+ )
+
+ assert response.success?
+ assert_instance_of ActiveShipping::LabelResponse, response
+ end
+
+ def test_create_shipment_with_insured_value
+ response = @carrier.create_shipment(
+ location_fixtures[:beverly_hills_with_name],
+ location_fixtures[:new_york_with_name],
+ package_fixtures.values_at(:insured_value),
:test => true
)
assert response.success?
assert_instance_of ActiveShipping::LabelResponse, response