summaryrefslogtreecommitdiffstats
path: root/framework/src/domain/mime/tests/mailtemplatetest.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-03 10:00:35 -0600
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-03 10:00:35 -0600
commitb7e18a461fd14ec34723d689f644880964314f1b (patch)
treef7ef6f625a987d8bd484ec283f4d1e5da38aa124 /framework/src/domain/mime/tests/mailtemplatetest.cpp
parentc71bc1b1fdd4055dfe2e2155961827b8652dd96c (diff)
downloadkube-b7e18a461fd14ec34723d689f644880964314f1b.tar.gz
kube-b7e18a461fd14ec34723d689f644880964314f1b.zip
Commit missing files
Diffstat (limited to 'framework/src/domain/mime/tests/mailtemplatetest.cpp')
-rw-r--r--framework/src/domain/mime/tests/mailtemplatetest.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/framework/src/domain/mime/tests/mailtemplatetest.cpp b/framework/src/domain/mime/tests/mailtemplatetest.cpp
index 62b17a6c..e814f75f 100644
--- a/framework/src/domain/mime/tests/mailtemplatetest.cpp
+++ b/framework/src/domain/mime/tests/mailtemplatetest.cpp
@@ -214,6 +214,36 @@ private slots:
214 qWarning() << "---------------------------------"; 214 qWarning() << "---------------------------------";
215 QCOMPARE(result->subject()->asUnicodeString(), subject); 215 QCOMPARE(result->subject()->asUnicodeString(), subject);
216 QVERIFY(result->contentType()->isMimeType("multipart/signed")); 216 QVERIFY(result->contentType()->isMimeType("multipart/signed"));
217
218 const auto contents = result->contents();
219 QCOMPARE(contents.size(), 2);
220 {
221 auto c = contents.at(0);
222 QVERIFY(c->contentType()->isMimeType("text/plain"));
223 }
224 {
225 auto c = contents.at(1);
226 QVERIFY(c->contentType()->isMimeType("application/pgp-signature"));
227 }
228 }
229
230 void testCreatePlainMailWithAttachmentsSigned()
231 {
232 QStringList to = {{"to@example.org"}};
233 QStringList cc = {{"cc@example.org"}};;
234 QStringList bcc = {{"bcc@example.org"}};;
235 KMime::Types::Mailbox from;
236 from.fromUnicodeString("from@example.org");
237 QString subject = "subject";
238 QString body = "body";
239 QList<Attachment> attachments = {{"name", "filename", "mimetype", true, "inlineAttachment"}, {"name", "filename", "mimetype", false, "nonInlineAttachment"}};
240
241 std::vector<GpgME::Key> keys = getKeys();
242
243 auto result = MailTemplates::createMessage({}, to, cc, bcc, from, subject, body, attachments, keys);
244
245 QVERIFY(result);
246 QVERIFY(result->contentType()->isMimeType("multipart/signed"));
217 } 247 }
218}; 248};
219 249