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 | 330c5988edd7360d03bc835d2434bc02cd3529e8 (patch) | |
tree | caea775229c9810c4c5b254f70508dc4fc69ce28 | |
parent | d24b7ceb6d771aefc89d827005f5441d3cd2ca6c (diff) | |
download | prosody-330c5988edd7360d03bc835d2434bc02cd3529e8.tar.gz prosody-330c5988edd7360d03bc835d2434bc02cd3529e8.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; |