Permalink
Browse files

Use utc in #timestamp_from_business_day and fix UPS delivery range test

  • Loading branch information...
1 parent 90e0ac9 commit 6cb087d3facf5e9e12e89ba4852c83f5303214a4 Denis Odorcic committed Jul 5, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/active_shipping/shipping/carrier.rb
  2. +2 −2 test/unit/carriers/ups_test.rb
@@ -68,7 +68,7 @@ def save_request(r)
def timestamp_from_business_day(days)
return unless days
- date = DateTime.now
+ date = DateTime.now.utc
days.times do
begin
date = date + 1
@@ -136,13 +136,13 @@ def test_response_parsing
def test_delivery_range_takes_weekend_into_consideration
mock_response = xml_fixture('ups/test_real_home_as_residential_destination_response')
@carrier.expects(:commit).returns(mock_response)
+ Timecop.freeze(DateTime.new(2012, 6, 15))
response = @carrier.find_rates( @locations[:beverly_hills],
@locations[:real_home_as_residential],
@packages.values_at(:chocolate_stuff))
- Timecop.freeze(DateTime.new(2012, 6, 15))
date_test = [nil, 3, 2, 1, 1, 1].map do |days|
- DateTime.now + days + 3 if days
+ DateTime.now.utc + days + 2 if days
end
Timecop.return

0 comments on commit 6cb087d

Please sign in to comment.