From 330c5988edd7360d03bc835d2434bc02cd3529e8 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sun, 12 Aug 2018 11:34:28 +0100 Subject: util.pubsub tests: Add initial node config tests --- spec/util_pubsub_spec.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'spec') 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; -- cgit v1.2.3