summaryrefslogtreecommitdiffstats
path: root/tests/accountstest.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-15 07:04:38 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-15 07:12:13 +0200
commit49f08fa2fadb3ff1340af02be27045e92566dd58 (patch)
tree790459634dbf37ff395112fc9b553481d6a355ab /tests/accountstest.cpp
parent80d8ad9f3b10bb8ad3123d1b18f2cd2cd816d452 (diff)
downloadsink-49f08fa2fadb3ff1340af02be27045e92566dd58.tar.gz
sink-49f08fa2fadb3ff1340af02be27045e92566dd58.zip
Fixed LocalStorageFacade.
We can't make any assumptions about the lifetime of the facade, so make sure we have all we need in the lambda.
Diffstat (limited to 'tests/accountstest.cpp')
-rw-r--r--tests/accountstest.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/accountstest.cpp b/tests/accountstest.cpp
index 12e4685..5a63b31 100644
--- a/tests/accountstest.cpp
+++ b/tests/accountstest.cpp
@@ -101,20 +101,19 @@ private slots:
101 Query query; 101 Query query;
102 query.liveQuery = true; 102 query.liveQuery = true;
103 auto model = Store::loadModel<SinkAccount>(query); 103 auto model = Store::loadModel<SinkAccount>(query);
104 QSignalSpy spy(model.data(), &QAbstractItemModel::rowsInserted); 104 QTRY_COMPARE(model->rowCount(QModelIndex()), 1);
105 QTRY_COMPARE(spy.count(), 1);
106 105
107 auto account2 = ApplicationDomainType::createEntity<SinkAccount>(); 106 auto account2 = ApplicationDomainType::createEntity<SinkAccount>();
108 account2.setProperty("type", "maildir"); 107 account2.setProperty("type", "maildir");
109 account2.setProperty("name", "name"); 108 account2.setProperty("name", "name");
110 Store::create(account2).exec().waitForFinished(); 109 Store::create(account2).exec().waitForFinished();
111 QTRY_COMPARE(spy.count(), 2); 110 QTRY_COMPARE(model->rowCount(QModelIndex()), 2);
112 111
113 //Ensure the notifier only affects one type 112 //Ensure the notifier only affects one type
114 auto resource = ApplicationDomainType::createEntity<SinkResource>(); 113 auto resource = ApplicationDomainType::createEntity<SinkResource>();
115 resource.setProperty("type", "org.kde.mailtransport"); 114 resource.setProperty("type", "org.kde.mailtransport");
116 Store::create(resource).exec().waitForFinished(); 115 Store::create(resource).exec().waitForFinished();
117 QTRY_COMPARE(spy.count(), 2); 116 QTRY_COMPARE(model->rowCount(QModelIndex()), 2);
118 } 117 }
119 118
120}; 119};