diff options
author | Kim Alvefur <zash@zash.se> | 2018-05-20 15:20:34 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-05-20 15:20:34 +0200 |
commit | ce7f4090d4a82a4c9f801eb37f07b27aba8c36a0 (patch) | |
tree | 11fa3173cc197f2d90b1b9713762aea16ae2203d | |
parent | bf88bf5c59e1112b049e8bacd0b1f6f2d63e064c (diff) | |
download | prosody-ce7f4090d4a82a4c9f801eb37f07b27aba8c36a0.tar.gz prosody-ce7f4090d4a82a4c9f801eb37f07b27aba8c36a0.zip |
spec/util_pubsub: Test whether someone can subscribe to a node
Test fails because of missing normalize_jid
-rw-r--r-- | spec/util_pubsub_spec.lua | 14 |
1 files changed, 13 insertions, 1 deletions
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); |