diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-01-23 14:24:30 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-01-23 14:24:30 +0100 |
commit | 5ef044eab02e1e8429a05b45398566ad81124fb6 (patch) | |
tree | 4723f9def75b89be2bbf57f8fa36dcbbf05ad824 /tests/mailsynctest.cpp | |
parent | 5df2b7c593594e61e403273c44ceae29207448c4 (diff) | |
download | sink-5ef044eab02e1e8429a05b45398566ad81124fb6.tar.gz sink-5ef044eab02e1e8429a05b45398566ad81124fb6.zip |
Fixed imap tests
Adding the mail to cyrus imap somehow broke with cyrus 3.0.
We're now creating the mail instead, before trying to sync it.
Diffstat (limited to 'tests/mailsynctest.cpp')
-rw-r--r-- | tests/mailsynctest.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/mailsynctest.cpp b/tests/mailsynctest.cpp index 2d480f7..058cae4 100644 --- a/tests/mailsynctest.cpp +++ b/tests/mailsynctest.cpp | |||
@@ -261,6 +261,12 @@ void MailSyncTest::testListRemovedSubFolder() | |||
261 | 261 | ||
262 | void MailSyncTest::testListMails() | 262 | void MailSyncTest::testListMails() |
263 | { | 263 | { |
264 | auto msg = KMime::Message::Ptr::create(); | ||
265 | msg->subject(true)->fromUnicodeString("This is a Subject.", "utf8"); | ||
266 | msg->date(true)->setDateTime(QDateTime::currentDateTimeUtc()); | ||
267 | msg->assemble(); | ||
268 | createMessage(QStringList() << "test", msg->encodedContent(true)); | ||
269 | |||
264 | Sink::Query query; | 270 | Sink::Query query; |
265 | query.resourceFilter(mResourceInstanceIdentifier); | 271 | query.resourceFilter(mResourceInstanceIdentifier); |
266 | query.request<Mail::Subject>().request<Mail::MimeMessage>().request<Mail::Folder>().request<Mail::Date>(); | 272 | query.request<Mail::Subject>().request<Mail::MimeMessage>().request<Mail::Folder>().request<Mail::Date>(); |
@@ -272,7 +278,7 @@ void MailSyncTest::testListMails() | |||
272 | auto job = Store::fetchAll<Mail>(query).then([](const QList<Mail::Ptr> &mails) { | 278 | auto job = Store::fetchAll<Mail>(query).then([](const QList<Mail::Ptr> &mails) { |
273 | ASYNCCOMPARE(mails.size(), 1); | 279 | ASYNCCOMPARE(mails.size(), 1); |
274 | auto mail = mails.first(); | 280 | auto mail = mails.first(); |
275 | ASYNCVERIFY(mail->getSubject().startsWith(QString("[Nepomuk] Jenkins build is still unstable"))); | 281 | ASYNCVERIFY(mail->getSubject().startsWith(QString("This is a Subject."))); |
276 | const auto data = mail->getMimeMessage(); | 282 | const auto data = mail->getMimeMessage(); |
277 | ASYNCVERIFY(!data.isEmpty()); | 283 | ASYNCVERIFY(!data.isEmpty()); |
278 | 284 | ||