Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding test for Canada Post's turn_around_time option

  • Loading branch information...
commit a0110beae5cfb50f627b462c89a6b46788f3953d 1 parent 2ca9ac3
@peterjm peterjm authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 test/unit/carriers/canada_post_test.rb
View
16 test/unit/carriers/canada_post_test.rb
@@ -93,6 +93,22 @@ def test_non_success_parse_rate_response
end
end
+ def test_turn_around_time_default
+ @carrier.expects(:commit).with do |request|
+ parsed_request = Hash.from_xml(request)
+ parsed_request['eparcel']['turnAroundTime'] == "24"
+ end
+ @carrier.find_rates(@origin, @destination, @line_items)
+ end
+
+ def test_turn_around_time
+ @carrier.expects(:commit).with do |request|
+ parsed_request = Hash.from_xml(request)
+ parsed_request['eparcel']['turnAroundTime'] == "0"
+ end
+ @carrier.find_rates(@origin, @destination, @line_items, :turn_around_time => 0)
+ end
+
def test_build_line_items
xml_line_items = @carrier.send(:build_line_items, @line_items)
assert_instance_of XmlNode, xml_line_items
Please sign in to comment.
Something went wrong with that request. Please try again.