From ce7f4090d4a82a4c9f801eb37f07b27aba8c36a0 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 20 May 2018 15:20:34 +0200 Subject: spec/util_pubsub: Test whether someone can subscribe to a node Test fails because of missing normalize_jid --- spec/util_pubsub_spec.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/util_pubsub_spec.lua b/spec/util_pubsub_spec.lua index 3221ad6c..1c9a9e02 100644 --- a/spec/util_pubsub_spec.lua +++ b/spec/util_pubsub_spec.lua @@ -31,12 +31,24 @@ describe("util.pubsub", function () describe("simple publishing", function () local broadcaster = spy.new(function () end); - local service = pubsub.new({ broadcaster = broadcaster; }); + local service = pubsub.new({ + broadcaster = broadcaster; + capabilities = { + none = { + subscribe = true; + be_subscribed = true; + }; + } + }); it("creates a node", function () assert.truthy(service:create("node", true)); end); + it("lets someone subscribe", function () + assert.truthy(service:add_subscription("node", true, "someone")); + end); + it("publishes an item", function () assert.truthy(service:publish("node", true, "1", "item 1")); end); -- cgit v1.2.3