aboutsummaryrefslogtreecommitdiffstats
path: root/spec/core_storagemanager_spec.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-10-10 22:03:11 +0100
committerMatthew Wild <mwild1@gmail.com>2018-10-10 22:03:11 +0100
commit6b841f66fd7aca6bdbf36bc747de4d2e14a4a521 (patch)
tree27f78f29c8fef727988468393efb0631b6e3b2ad /spec/core_storagemanager_spec.lua
parent038921d7e0769ab68480af75e06e70263180012d (diff)
downloadprosody-6b841f66fd7aca6bdbf36bc747de4d2e14a4a521.tar.gz
prosody-6b841f66fd7aca6bdbf36bc747de4d2e14a4a521.zip
storagemanager tests: Add some additional checks
Diffstat (limited to 'spec/core_storagemanager_spec.lua')
-rw-r--r--spec/core_storagemanager_spec.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/core_storagemanager_spec.lua b/spec/core_storagemanager_spec.lua
index ea518c62..25e5cc6a 100644
--- a/spec/core_storagemanager_spec.lua
+++ b/spec/core_storagemanager_spec.lua
@@ -108,7 +108,9 @@ describe("storagemanager", function ()
with = "contact@example.com";
});
assert.truthy(data);
+ local count = 0;
for id, item, when in data do
+ count = count + 1;
assert.truthy(id);
assert(st.is_stanza(item));
assert.equal("test", item.name);
@@ -116,10 +118,20 @@ describe("storagemanager", function ()
assert.equal(2, #item.tags);
assert.equal(test_time, when);
end
+ assert.equal(1, count);
end);
it("can be purged", function ()
local ok, err = archive:delete("user");
assert.truthy(ok);
+ local data, err = archive:find("user", {
+ with = "contact@example.com";
+ });
+ assert.truthy(data);
+ local count = 0;
+ for id, item, when in data do -- luacheck: ignore id item when
+ count = count + 1;
+ end
+ assert.equal(0, count);
end);
end);
end);