# HG changeset patch # User Kim Alvefur # Date 1526822434 -7200 # Node ID 9a3066a580ad17741745dd9a1e798b5dae0344a9 # Parent 0f9d5cfa84f9c7e2d1c64376400291d9bc30d0ec spec/util_pubsub: Test whether someone can subscribe to a node Test fails because of missing normalize_jid diff -r 0f9d5cfa84f9 -r 9a3066a580ad spec/util_pubsub_spec.lua --- a/spec/util_pubsub_spec.lua Tue May 22 01:32:44 2018 +0200 +++ b/spec/util_pubsub_spec.lua Sun May 20 15:20:34 2018 +0200 @@ -31,12 +31,24 @@ 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);