diff options
-rw-r--r-- | common/domain/applicationdomaintype.h | 3 | ||||
-rw-r--r-- | common/store.cpp | 2 | ||||
-rw-r--r-- | tests/accountstest.cpp | 12 |
3 files changed, 16 insertions, 1 deletions
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index 55207d0..c94a987 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h | |||
@@ -194,6 +194,9 @@ template<> | |||
194 | QByteArray SINK_EXPORT getTypeName<SinkAccount>(); | 194 | QByteArray SINK_EXPORT getTypeName<SinkAccount>(); |
195 | 195 | ||
196 | template<> | 196 | template<> |
197 | QByteArray SINK_EXPORT getTypeName<Identity>(); | ||
198 | |||
199 | template<> | ||
197 | QByteArray SINK_EXPORT getTypeName<Mail>(); | 200 | QByteArray SINK_EXPORT getTypeName<Mail>(); |
198 | 201 | ||
199 | template<> | 202 | template<> |
diff --git a/common/store.cpp b/common/store.cpp index 02d868f..0321583 100644 --- a/common/store.cpp +++ b/common/store.cpp | |||
@@ -54,7 +54,7 @@ QString Store::getTemporaryFilePath() | |||
54 | static QList<QByteArray> getResources(const QList<QByteArray> &resourceFilter, const QByteArray &type = QByteArray()) | 54 | static QList<QByteArray> getResources(const QList<QByteArray> &resourceFilter, const QByteArray &type = QByteArray()) |
55 | { | 55 | { |
56 | // Return the global resource (signified by an empty name) for types that don't belong to a specific resource | 56 | // Return the global resource (signified by an empty name) for types that don't belong to a specific resource |
57 | if (type == "sinkresource" || type == "sinkaccount") { | 57 | if (type == "sinkresource" || type == "sinkaccount" || type == "identity") { |
58 | return QList<QByteArray>() << ""; | 58 | return QList<QByteArray>() << ""; |
59 | } | 59 | } |
60 | QList<QByteArray> resources; | 60 | QList<QByteArray> resources; |
diff --git a/tests/accountstest.cpp b/tests/accountstest.cpp index 6f109f8..12e4685 100644 --- a/tests/accountstest.cpp +++ b/tests/accountstest.cpp | |||
@@ -68,6 +68,18 @@ private slots: | |||
68 | }) | 68 | }) |
69 | .exec().waitForFinished(); | 69 | .exec().waitForFinished(); |
70 | 70 | ||
71 | auto identity = ApplicationDomainType::createEntity<Identity>(); | ||
72 | identity.setProperty("name", smtpServer); | ||
73 | identity.setProperty("address", smtpUsername); | ||
74 | identity.setProperty("account", account.identifier()); | ||
75 | Store::create(identity).exec().waitForFinished(); | ||
76 | |||
77 | Store::fetchAll<Identity>(Query()).then<void, QList<Identity::Ptr>>([&](const QList<Identity::Ptr> &identities) { | ||
78 | QCOMPARE(identities.size(), 1); | ||
79 | }) | ||
80 | .exec().waitForFinished(); | ||
81 | |||
82 | |||
71 | Store::remove(resource).exec().waitForFinished(); | 83 | Store::remove(resource).exec().waitForFinished(); |
72 | 84 | ||
73 | Store::fetchAll<SinkResource>(Query()).then<void, QList<SinkResource>>([](const QList<SinkResource> &resources) { | 85 | Store::fetchAll<SinkResource>(Query()).then<void, QList<SinkResource>>([](const QList<SinkResource> &resources) { |