diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-08-12 11:34:28 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-08-12 11:34:28 +0100 |
commit | bdc1aa1462d4960f907ee778e6e5d9726ec6291a (patch) | |
tree | caea775229c9810c4c5b254f70508dc4fc69ce28 | |
parent | eb90269c43b1b40a4388173d904b97eeca6d0bf7 (diff) | |
download | prosody-bdc1aa1462d4960f907ee778e6e5d9726ec6291a.tar.gz prosody-bdc1aa1462d4960f907ee778e6e5d9726ec6291a.zip |
util.pubsub tests: Add initial node config tests
-rw-r--r-- | spec/util_pubsub_spec.lua | 18 |
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; |