From aa0f110afe23058e6d9e1c40b957036563b1fb34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Wed, 31 Jul 2019 13:11:27 +0200 Subject: [PATCH] Add test that trigger get_only_item in pubsub --- test/pubsub_tests.erl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/pubsub_tests.erl b/test/pubsub_tests.erl index b4950ef33..3552f7263 100644 --- a/test/pubsub_tests.erl +++ b/test/pubsub_tests.erl @@ -55,6 +55,7 @@ single_cases() -> single_test(test_delete_item), single_test(test_purge), single_test(test_subscribe), + single_test(test_subscribe_max_item_1), single_test(test_unsubscribe)]}. test_features(Config) -> @@ -163,6 +164,16 @@ test_subscribe(Config) -> delete_node(Config, Node), disconnect(Config). +test_subscribe_max_item_1(Config) -> + DefaultNodeConfig = get_default_node_config(Config), + CustomNodeConfig = set_opts(DefaultNodeConfig, + [{max_items, 1}]), + Node = create_node(Config, <<>>, CustomNodeConfig), + #ps_subscription{type = subscribed} = subscribe_node(Config, Node), + [#ps_subscription{node = Node}] = get_subscriptions(Config), + delete_node(Config, Node), + disconnect(Config). + test_unsubscribe(Config) -> Node = create_node(Config, <<>>), subscribe_node(Config, Node),