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 | 6e658ef651e451f771d65fac290ad34917812dc4 (patch) | |
tree | 11fa3173cc197f2d90b1b9713762aea16ae2203d | |
parent | ee883aff478f701f9c6411ed5f9bc9df562acc6f (diff) | |
download | prosody-6e658ef651e451f771d65fac290ad34917812dc4.tar.gz prosody-6e658ef651e451f771d65fac290ad34917812dc4.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); |