summaryrefslogtreecommitdiffstats
path: root/tests/maildirresourcetest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/maildirresourcetest.cpp')
-rw-r--r--tests/maildirresourcetest.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/maildirresourcetest.cpp b/tests/maildirresourcetest.cpp
index 1e2d36b..b0bc30b 100644
--- a/tests/maildirresourcetest.cpp
+++ b/tests/maildirresourcetest.cpp
@@ -287,6 +287,30 @@ private Q_SLOTS:
287 QTRY_VERIFY(!QFileInfo(targetPath).exists()); 287 QTRY_VERIFY(!QFileInfo(targetPath).exists());
288 } 288 }
289 289
290 void testCreateMail()
291 {
292 Akonadi2::Query query;
293 query.resources << "org.kde.maildir.instance1";
294 query.syncOnDemand = false;
295 query.processAll = true;
296
297 //Ensure all local data is processed
298 Akonadi2::Store::synchronize(query).exec().waitForFinished();
299
300 Akonadi2::ApplicationDomain::Mail mail("org.kde.maildir.instance1");
301 mail.setProperty("name", "testCreateMail");
302
303 Akonadi2::Store::create(mail).exec().waitForFinished();
304
305 //Ensure all local data is processed
306 Akonadi2::Store::synchronize(query).exec().waitForFinished();
307
308 auto targetPath = tempDir.path() + "/maildir1/new";
309 QDir dir(targetPath);
310 dir.setFilter(QDir::Files);
311 QTRY_COMPARE(dir.count(), static_cast<unsigned int>(1));
312 }
313
290}; 314};
291 315
292QTEST_MAIN(MaildirResourceTest) 316QTEST_MAIN(MaildirResourceTest)