diff options
Diffstat (limited to 'accounts/maildir/tests/settingstest.cpp')
-rw-r--r-- | accounts/maildir/tests/settingstest.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/accounts/maildir/tests/settingstest.cpp b/accounts/maildir/tests/settingstest.cpp index 8f8471f0..07665c24 100644 --- a/accounts/maildir/tests/settingstest.cpp +++ b/accounts/maildir/tests/settingstest.cpp | |||
@@ -23,14 +23,20 @@ private slots: | |||
23 | { | 23 | { |
24 | auto accountId = "accountid"; | 24 | auto accountId = "accountid"; |
25 | auto maildirPath = QDir::tempPath(); | 25 | auto maildirPath = QDir::tempPath(); |
26 | auto smtpServer = QString("smtpserver"); | ||
27 | auto smtpUsername = QString("username"); | ||
28 | auto smtpPassword = QString("password"); | ||
26 | 29 | ||
27 | MaildirSettings settings; | 30 | MaildirSettings settings; |
28 | settings.setAccountIdentifier(accountId); | 31 | settings.setAccountIdentifier(accountId); |
29 | settings.setPath(maildirPath); | 32 | settings.setPath(maildirPath); |
33 | settings.setProperty("smtpServer", smtpServer); | ||
34 | settings.setProperty("smtpUsername", smtpUsername); | ||
35 | settings.setProperty("smtpPassword", smtpPassword); | ||
30 | settings.save(); | 36 | settings.save(); |
31 | 37 | ||
32 | Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).then<void, QList<Sink::ApplicationDomain::SinkResource>>([](const QList<Sink::ApplicationDomain::SinkResource> &resources) { | 38 | Sink::Store::fetchAll<Sink::ApplicationDomain::SinkResource>(Sink::Query()).then<void, QList<Sink::ApplicationDomain::SinkResource>>([](const QList<Sink::ApplicationDomain::SinkResource> &resources) { |
33 | QCOMPARE(resources.size(), 1); | 39 | QCOMPARE(resources.size(), 2); |
34 | }) | 40 | }) |
35 | .exec().waitForFinished(); | 41 | .exec().waitForFinished(); |
36 | 42 | ||
@@ -38,10 +44,15 @@ private slots: | |||
38 | { | 44 | { |
39 | MaildirSettings readSettings; | 45 | MaildirSettings readSettings; |
40 | QSignalSpy spy(&readSettings, &MaildirSettings::pathChanged); | 46 | QSignalSpy spy(&readSettings, &MaildirSettings::pathChanged); |
47 | QSignalSpy spy1(&readSettings, &MaildirSettings::smtpResourceChanged); | ||
41 | readSettings.setAccountIdentifier(accountId); | 48 | readSettings.setAccountIdentifier(accountId); |
42 | QTRY_VERIFY(spy.count()); | 49 | QTRY_VERIFY(spy.count()); |
50 | QTRY_VERIFY(spy1.count()); | ||
43 | QVERIFY(!readSettings.accountIdentifier().isEmpty()); | 51 | QVERIFY(!readSettings.accountIdentifier().isEmpty()); |
44 | QCOMPARE(readSettings.path().toString(), maildirPath); | 52 | QCOMPARE(readSettings.path().toString(), maildirPath); |
53 | QCOMPARE(readSettings.property("smtpServer").toString(), smtpServer); | ||
54 | QCOMPARE(readSettings.property("smtpUsername").toString(), smtpUsername); | ||
55 | QCOMPARE(readSettings.property("smtpPassword").toString(), smtpPassword); | ||
45 | } | 56 | } |
46 | 57 | ||
47 | { | 58 | { |