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

Take into account business hours for UPS delivery estimates #362

Merged
merged 1 commit into from
Apr 26, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/remote/ups_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def test_delivery_date_estimates_within_zip
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
Expand All @@ -302,7 +302,7 @@ def test_delivery_date_estimates_within_zip_with_no_value
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
Expand All @@ -321,9 +321,9 @@ def test_delivery_date_estimates_across_zips
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
Expand Down