aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_pubsub_spec.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-12-29 21:49:32 +0100
committerKim Alvefur <zash@zash.se>2018-12-29 21:49:32 +0100
commite23c17c3a040717e97287b3ea525002f1b58ffcd (patch)
tree498e285c672879ef0fb570aa419d07e536d58fb4 /spec/util_pubsub_spec.lua
parent5eb327274aa1ab27ec45b49e419943c264bd237d (diff)
parent9f19a48ee2c20e4269f3e3c53a9330bd25f48621 (diff)
downloadprosody-e23c17c3a040717e97287b3ea525002f1b58ffcd.tar.gz
prosody-e23c17c3a040717e97287b3ea525002f1b58ffcd.zip
Merge 0.11->trunk
Diffstat (limited to 'spec/util_pubsub_spec.lua')
-rw-r--r--spec/util_pubsub_spec.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/util_pubsub_spec.lua b/spec/util_pubsub_spec.lua
index c44832f7..6386100b 100644
--- a/spec/util_pubsub_spec.lua
+++ b/spec/util_pubsub_spec.lua
@@ -375,4 +375,34 @@ describe("util.pubsub", function ()
end);
end);
end);
+
+ describe("restoring data from nodestore", function ()
+ local nodestore = {
+ data = {
+ test = {
+ name = "test";
+ config = {};
+ affiliations = {};
+ subscribers = {
+ ["someone"] = true;
+ };
+ }
+ }
+ };
+ function nodestore:users()
+ return pairs(self.data)
+ end
+ function nodestore:get(key)
+ return self.data[key];
+ end
+ local service = pubsub.new({
+ nodestore = nodestore;
+ });
+ it("subscriptions", function ()
+ local ok, ret = service:get_subscriptions(nil, true, nil)
+ assert.is_true(ok);
+ assert.same({ { node = "test", jid = "someone", subscription = true, } }, ret);
+ end);
+ end);
+
end);