]> diplodocus.org Git - nmh/blobdiff - test/oauth/test-send
Use pwd -P to canonicalize MH_TEST_DIR.
[nmh] / test / oauth / test-send
index d75901ad393a642444c5a65218d62e3fc0eb837e..f41f89654235ff94cf7e9cf683ca7cd8ee4fdbc8 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Test the XOAUTH2 support in sen
+# Test the XOAUTH2 support in send
 #
 
 if test -z "${MH_OBJ_DIR}"; then
@@ -355,6 +355,24 @@ unset XOAUTH
 test_send_only_fakesmtp 'post: problem initializing server; [BHST] SMTP server does not support SASL XOAUTH2
 send: message not delivered to anyone'
 
+# TEST
+start_test 'botched json response'
+
+fake_creds <<EOF
+refresh-nobody@example.com: test-refresh
+EOF
+
+expect_http_post_refresh
+
+fake_json_response <<EOF
+{
+  "refresh_token": "refresh-toke
+}
+EOF
+
+test_send_only_fakehttp 'send: error refreshing OAuth2 token
+send: invalid response'
+
 clean_fakesmtp
 clean_fakehttp
 finish_test