./test/general/transporter_test.rb in exact4r-1.2 vs ./test/general/transporter_test.rb in exact4r-1.4
- old
+ new
@@ -46,9 +46,29 @@
tr = ::EWS::Transporter.new(@@credentials.config['location'])
resp = tr.submit(req, :json)
assert_not_nil resp
assert_equal 404, resp.error_number
- assert_equal "Not Found", resp.error_description
+ assert_equal "Not Found", resp.error_description.strip
+ end
+
+ def test_uses_supplied_certificates
+ req = ::EWS::Transaction::Request.new({
+ :transaction_type => :purchase,
+ :amount => "10.13",
+ :cardholder_name => "Simon Brown",
+ :cc_number => "4111111111111111",
+ :cc_expiry => "1012",
+ :reference_no => "987987",
+ }.merge(@@credentials.current_gateway))
+
+ tr = ::EWS::Transporter.new(@@credentials.config['location'], {
+ :issuer_cert => File.dirname(__FILE__)+"/../../certs/valicert_class2_root.crt",
+ :server_cert => File.dirname(__FILE__)+"/../../certs/e-xact.com.crt"
+ })
+ resp = tr.submit(req, :json)
+
+ assert_not_nil resp
+ assert resp.approved?
end
end