Permalink
Browse files

adding test for Canada Post's turn_around_time option

  • Loading branch information...
1 parent 2ca9ac3 commit a0110beae5cfb50f627b462c89a6b46788f3953d @peterjm peterjm committed Feb 25, 2013
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

0 comments on commit a0110be

Please sign in to comment.