summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-11 13:31:56 -0600
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-11 13:31:56 -0600
commitb6ffe9af5a00f93cd5e5dac1ebd8dabc475388e1 (patch)
tree874d4dfdb984a2b93a50d6b0903c397948c76e34
parente07a23c486f67cc2014af3fd8a639a13dd100162 (diff)
downloadkube-b6ffe9af5a00f93cd5e5dac1ebd8dabc475388e1.tar.gz
kube-b6ffe9af5a00f93cd5e5dac1ebd8dabc475388e1.zip
Test replies
-rw-r--r--framework/src/domain/mime/testdata/multirecipients.mbox11
-rw-r--r--framework/src/domain/mime/tests/mailtemplatetest.cpp16
2 files changed, 27 insertions, 0 deletions
diff --git a/framework/src/domain/mime/testdata/multirecipients.mbox b/framework/src/domain/mime/testdata/multirecipients.mbox
new file mode 100644
index 00000000..f4b5c4a8
--- /dev/null
+++ b/framework/src/domain/mime/testdata/multirecipients.mbox
@@ -0,0 +1,11 @@
1Return-Path: <konqi@example.org>
2Date: Wed, 8 Jun 2016 20:34:44 -0700
3From: Konqi <konqi@example.org>
4To: KDE release coordination <release-team@kde.org>,
5 "Bar, Foo" <kde-devel@kde.org>
6Subject: A random subject with alternative contenttype
7MIME-Version: 1.0
8Content-Type: text/plain; charset=utf-8
9Content-Transfer-Encoding: quoted-printable
10
11test
diff --git a/framework/src/domain/mime/tests/mailtemplatetest.cpp b/framework/src/domain/mime/tests/mailtemplatetest.cpp
index 92dfba65..51c5e243 100644
--- a/framework/src/domain/mime/tests/mailtemplatetest.cpp
+++ b/framework/src/domain/mime/tests/mailtemplatetest.cpp
@@ -165,6 +165,22 @@ private slots:
165 QCOMPARE(unquote(content), QLatin1String("sdlkjsdjf")); 165 QCOMPARE(unquote(content), QLatin1String("sdlkjsdjf"));
166 } 166 }
167 167
168 void testMultiRecipientReply()
169 {
170 auto msg = readMail("multirecipients.mbox");
171 KMime::Message::Ptr result;
172 MailTemplates::reply(msg, [&] (const KMime::Message::Ptr &r) {
173 result = r;
174 });
175 QTRY_VERIFY(result);
176 auto content = removeFirstLine(result->body());
177 QVERIFY(!content.isEmpty());
178 QCOMPARE(unquote(content), QLatin1String("test"));
179 QCOMPARE(result->to()->addresses(), {{"konqi@example.org"}});
180 auto l = QVector<QByteArray>{{"release-team@kde.org"}, {"kde-devel@kde.org"}};
181 QCOMPARE(result->cc()->addresses(), l);
182 }
183
168 void testCreatePlainMail() 184 void testCreatePlainMail()
169 { 185 {
170 QStringList to = {{"to@example.org"}}; 186 QStringList to = {{"to@example.org"}};