./test/general/request_test.rb in exact4r-1.1 vs ./test/general/request_test.rb in exact4r-1.2
- old
+ new
@@ -140,9 +140,20 @@
response = transporter.submit(request)
assert_equal fake_response, response
assert response.approved?
assert_equal "Transaction Normal", response.exact_message
end
+
+ def test_wont_send_invalid_amounts
+ [-0.01, "-0.01", 100000, "100000"].each do |amt|
+ transporter = EWS::Transporter.new(@@credentials.config['location'])
+
+ transporter.expects(:build_http_request).never
+
+ original_resp = transporter.submit(basic_new_transaction(:amount => amt), :json)
+ assert !original_resp
+ end
+ end
private
def basic_find_transaction(options = {})
params = {
:transaction_type => :transaction_details