aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_pubsub_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/util_pubsub_spec.lua')
-rw-r--r--spec/util_pubsub_spec.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/util_pubsub_spec.lua b/spec/util_pubsub_spec.lua
index d63e2206..2c7676ea 100644
--- a/spec/util_pubsub_spec.lua
+++ b/spec/util_pubsub_spec.lua
@@ -181,6 +181,30 @@ describe("util.pubsub", function ()
assert.equals("forbidden", err);
end);
end);
+ describe("change", function ()
+ local service;
+ before_each(function ()
+ service = pubsub.new();
+ service:create("test", true, { access_model = "open" });
+ end);
+ it("affects existing subscriptions", function ()
+ do
+ local ok = service:add_subscription("test", "stranger", "stranger");
+ assert.is_true(ok);
+ end
+ do
+ local ok, sub = service:get_subscription("test", "stranger", "stranger");
+ assert.is_true(ok);
+ assert.is_true(sub);
+ end
+ assert(service:set_node_config("test", true, { access_model = "whitelist" }));
+ do
+ local ok, sub = service:get_subscription("test", "stranger", "stranger");
+ assert.is_true(ok);
+ assert.is_nil(sub);
+ end
+ end);
+ end);
end);
describe("publish model", function ()