Software / code / prosody
Comparison
spec/util_pubsub_spec.lua @ 9174:160032d55ff1
util.pubsub tests: Add initial node config tests
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sun, 12 Aug 2018 11:34:28 +0100 |
| parent | 9173:c53663e13b51 |
| child | 9175:43b6f67aba05 |
comparison
equal
deleted
inserted
replaced
| 9173:c53663e13b51 | 9174:160032d55ff1 |
|---|---|
| 122 }, ret); | 122 }, ret); |
| 123 end); | 123 end); |
| 124 | 124 |
| 125 end); | 125 end); |
| 126 | 126 |
| 127 describe("node config", function () | |
| 128 local service; | |
| 129 before_each(function () | |
| 130 service = pubsub.new(); | |
| 131 service:create("test", true); | |
| 132 end); | |
| 133 it("access is forbidden for unaffiliated entities", function () | |
| 134 local ok, err = service:get_node_config("test", "stranger"); | |
| 135 assert.is_falsy(ok); | |
| 136 assert.equals("forbidden", err); | |
| 137 end); | |
| 138 it("returns an error for nodes that do not exist", function () | |
| 139 local ok, err = service:get_node_config("nonexistent", true); | |
| 140 assert.is_falsy(ok); | |
| 141 assert.equals("item-not-found", err); | |
| 142 end); | |
| 143 end); | |
| 144 | |
| 127 describe("access model", function () | 145 describe("access model", function () |
| 128 describe("open", function () | 146 describe("open", function () |
| 129 local service; | 147 local service; |
| 130 before_each(function () | 148 before_each(function () |
| 131 service = pubsub.new(); | 149 service = pubsub.new(); |