Software /
code /
prosody
Comparison
spec/util_pubsub_spec.lua @ 8817:9a3066a580ad
spec/util_pubsub: Test whether someone can subscribe to a node
Test fails because of missing normalize_jid
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 20 May 2018 15:20:34 +0200 |
parent | 8647:638ff2ad98e6 |
child | 9004:50a0f405e6c9 |
comparison
equal
deleted
inserted
replaced
8816:0f9d5cfa84f9 | 8817:9a3066a580ad |
---|---|
29 end); | 29 end); |
30 end); | 30 end); |
31 | 31 |
32 describe("simple publishing", function () | 32 describe("simple publishing", function () |
33 local broadcaster = spy.new(function () end); | 33 local broadcaster = spy.new(function () end); |
34 local service = pubsub.new({ broadcaster = broadcaster; }); | 34 local service = pubsub.new({ |
35 broadcaster = broadcaster; | |
36 capabilities = { | |
37 none = { | |
38 subscribe = true; | |
39 be_subscribed = true; | |
40 }; | |
41 } | |
42 }); | |
35 | 43 |
36 it("creates a node", function () | 44 it("creates a node", function () |
37 assert.truthy(service:create("node", true)); | 45 assert.truthy(service:create("node", true)); |
46 end); | |
47 | |
48 it("lets someone subscribe", function () | |
49 assert.truthy(service:add_subscription("node", true, "someone")); | |
38 end); | 50 end); |
39 | 51 |
40 it("publishes an item", function () | 52 it("publishes an item", function () |
41 assert.truthy(service:publish("node", true, "1", "item 1")); | 53 assert.truthy(service:publish("node", true, "1", "item 1")); |
42 end); | 54 end); |