X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT630-emacs-draft.sh;h=cd9e33a7c4057505986338b8716fd231b30e8643;hp=e39690cadd16c4e971491c3100102a794dbce6bb;hb=936c35da86aebf76b14f4ba198f760403455cfe0;hpb=d820b97477f5705640aa8dcf9dcf311e37508def diff --git a/test/T630-emacs-draft.sh b/test/T630-emacs-draft.sh index e39690ca..cd9e33a7 100755 --- a/test/T630-emacs-draft.sh +++ b/test/T630-emacs-draft.sh @@ -32,11 +32,41 @@ test_begin_subtest "Saving a signed draft adds header" test_emacs '(notmuch-mua-mail) (message-goto-subject) (insert "draft-test-0003") - (mml-secure-message-sign) + ;; We would use (mml-secure-message-sign) but on emacs23 + ;; that only signs the part, not the whole message. + (mml-secure-message mml-secure-method '\''sign) (notmuch-draft-save) (test-output)' header_count=$(notmuch show --format=raw subject:draft-test-0003 | grep -c ^X-Notmuch-Emacs-Secure) body_count=$(notmuch notmuch show --format=raw subject:draft-test-0003 | grep -c '^\<#secure') test_expect_equal "$header_count,$body_count" "1,0" +test_begin_subtest "Refusing to save an encrypted draft" +test_emacs '(notmuch-mua-mail) + (message-goto-subject) + (insert "draft-test-0004") + (mml-secure-message-sign-encrypt) + (let ((notmuch-draft-save-plaintext nil)) + (notmuch-draft-save)) + (test-output)' +count1=$(notmuch count tag:draft) +count2=$(notmuch count subject:draft-test-0004) + +test_expect_equal "$count1,$count2" "3,0" + +test_begin_subtest "Resuming a signed draft" + +test_emacs '(notmuch-show "subject:draft-test-0003") + (notmuch-show-resume-message) + (test-output)' +notmuch_dir_sanitize OUTPUT > OUTPUT.clean +cat <EXPECTED +From: Notmuch Test Suite +To: +Subject: draft-test-0003 +Fcc: MAIL_DIR/sent +--text follows this line-- +<#secure method=pgpmime mode=sign> +EOF +test_expect_equal_file EXPECTED OUTPUT.clean test_done