aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-01-12 18:03:40 +0100
committerKim Alvefur <zash@zash.se>2021-01-12 18:03:40 +0100
commitd5fb7e25107b80aaf000c025b148f0281e748062 (patch)
tree778ff9b2cab251b09637c84d6d43f7c5375737b8 /spec
parent7a4f8adb703ed93d1b0250ed6f9a72515efd49af (diff)
downloadprosody-d5fb7e25107b80aaf000c025b148f0281e748062.tar.gz
prosody-d5fb7e25107b80aaf000c025b148f0281e748062.zip
storage tests: Add test for querying a set of IDs
Diffstat (limited to 'spec')
-rw-r--r--spec/core_storagemanager_spec.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/core_storagemanager_spec.lua b/spec/core_storagemanager_spec.lua
index 5ba1748c..033559b4 100644
--- a/spec/core_storagemanager_spec.lua
+++ b/spec/core_storagemanager_spec.lua
@@ -382,6 +382,30 @@ describe("storagemanager", function ()
assert.equal(2, count);
end);
+ it("by multiple ids", function ()
+ assert.truthy(archive.caps and archive.caps.ids, "Multilpe ID query")
+ local data, err = archive:find("user", {
+ ["ids"] = {
+ test_data[2][1];
+ test_data[4][1];
+ };
+ });
+ assert.truthy(data, err);
+ local count = 0;
+ for id, item in data do
+ count = count + 1;
+ assert.truthy(id);
+ assert.equal(test_data[count==1 and 2 or 4][1], id);
+ assert(st.is_stanza(item));
+ assert.equal("test", item.name);
+ assert.equal("urn:example:foo", item.attr.xmlns);
+ assert.equal(2, #item.tags);
+ end
+ assert.equal(2, count);
+
+ end);
+
+
end);
it("can selectively delete items", function ()