Software /
code /
prosody
Comparison
spec/util_pubsub_spec.lua @ 9209:69e17edf8796
util.pubsub tests: Fix whitespace
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 18 Aug 2018 18:14:19 +0200 |
parent | 9208:d3bb59ec0173 |
child | 9451:db82b096b842 |
comparison
equal
deleted
inserted
replaced
9208:d3bb59ec0173 | 9209:69e17edf8796 |
---|---|
268 assert.is_falsy(ok); | 268 assert.is_falsy(ok); |
269 assert.equals("forbidden", err); | 269 assert.equals("forbidden", err); |
270 end); | 270 end); |
271 it("should allow subscribers to publish without an affiliation", function () | 271 it("should allow subscribers to publish without an affiliation", function () |
272 assert.is_true(service:add_subscription("test", "stranger", "stranger")); | 272 assert.is_true(service:add_subscription("test", "stranger", "stranger")); |
273 local ok = service:publish("test", "stranger", "item1", "foo"); | 273 local ok = service:publish("test", "stranger", "item1", "foo"); |
274 assert.is_true(ok); | 274 assert.is_true(ok); |
275 end); | 275 end); |
276 it("should allow publishers to publish without a subscription", function () | 276 it("should allow publishers to publish without a subscription", function () |
277 assert(service:set_affiliation("test", true, "mypublisher", "publisher")); | 277 assert(service:set_affiliation("test", true, "mypublisher", "publisher")); |
278 local ok, err = service:publish("test", "mypublisher", "item1", "foo"); | 278 local ok, err = service:publish("test", "mypublisher", "item1", "foo"); |
318 end); | 318 end); |
319 it("returns no items on an empty node", function () | 319 it("returns no items on an empty node", function () |
320 local ok, items = service:get_items("test", true); | 320 local ok, items = service:get_items("test", true); |
321 assert.is_true(ok); | 321 assert.is_true(ok); |
322 assert.equal(0, #items); | 322 assert.equal(0, #items); |
323 assert.is_nil(next(items)); | 323 assert.is_nil(next(items)); |
324 end); | 324 end); |
325 it("returns no items on an empty node", function () | 325 it("returns no items on an empty node", function () |
326 local ok, items = service:get_items("test", true); | 326 local ok, items = service:get_items("test", true); |
327 assert.is_true(ok); | 327 assert.is_true(ok); |
328 assert.equal(0, #items); | 328 assert.equal(0, #items); |