From f1138baa80204b07857c182e6d50fb6f2c66aa5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Thu, 16 Jun 2016 11:12:16 +0200 Subject: [PATCH] Add test for more allowed access_rules --- test/acl_test.exs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/acl_test.exs b/test/acl_test.exs index ccf518037..38f0372e6 100644 --- a/test/acl_test.exs +++ b/test/acl_test.exs @@ -315,6 +315,10 @@ defmodule ACLTest do assert :acl.transform_access_rules_config([100]) == [{100, [:all]}] end + test "transform_access_rules_config expands rule" do + assert :acl.transform_access_rules_config([:fast]) == [{:fast, [:all]}] + end + test "transform_access_rules_config expands allow: rule" do assert :acl.transform_access_rules_config([{:allow, :test1}]) == [{:allow, [{:acl, :test1}]}] end @@ -327,6 +331,26 @@ defmodule ACLTest do assert :acl.transform_access_rules_config([{100, :test1}]) == [{100, [{:acl, :test1}]}] end + test "transform_access_rules_config expands : rule" do + assert :acl.transform_access_rules_config([{:fast, :test1}]) == [{:fast, [{:acl, :test1}]}] + end + + test "transform_access_rules_config expands allow rule (no list)" do + assert :acl.transform_access_rules_config(:allow) == [{:allow, [:all]}] + end + + test "transform_access_rules_config expands deny rule (no list)" do + assert :acl.transform_access_rules_config(:deny) == [{:deny, [:all]}] + end + + test "transform_access_rules_config expands rule (no list)" do + assert :acl.transform_access_rules_config(100) == [{100, [:all]}] + end + + test "transform_access_rules_config expands rule (no list)" do + assert :acl.transform_access_rules_config(:fast) == [{:fast, [:all]}] + end + ## Checking ACL on both user pattern and IP ## ========================================