aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-08-12 11:34:28 +0100
committerMatthew Wild <mwild1@gmail.com>2018-08-12 11:34:28 +0100
commitbdc1aa1462d4960f907ee778e6e5d9726ec6291a (patch)
treecaea775229c9810c4c5b254f70508dc4fc69ce28
parenteb90269c43b1b40a4388173d904b97eeca6d0bf7 (diff)
downloadprosody-bdc1aa1462d4960f907ee778e6e5d9726ec6291a.tar.gz
prosody-bdc1aa1462d4960f907ee778e6e5d9726ec6291a.zip
util.pubsub tests: Add initial node config tests
-rw-r--r--spec/util_pubsub_spec.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/util_pubsub_spec.lua b/spec/util_pubsub_spec.lua
index 5ee5a14b..d63e2206 100644
--- a/spec/util_pubsub_spec.lua
+++ b/spec/util_pubsub_spec.lua
@@ -124,6 +124,24 @@ describe("util.pubsub", function ()
end);
+ describe("node config", function ()
+ local service;
+ before_each(function ()
+ service = pubsub.new();
+ service:create("test", true);
+ end);
+ it("access is forbidden for unaffiliated entities", function ()
+ local ok, err = service:get_node_config("test", "stranger");
+ assert.is_falsy(ok);
+ assert.equals("forbidden", err);
+ end);
+ it("returns an error for nodes that do not exist", function ()
+ local ok, err = service:get_node_config("nonexistent", true);
+ assert.is_falsy(ok);
+ assert.equals("item-not-found", err);
+ end);
+ end);
+
describe("access model", function ()
describe("open", function ()
local service;