added consent module, nesting mdoules now functional!
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
dofile("../modpol.lua")
|
||||
|
||||
print('\nRemoving existing orgs')
|
||||
modpol.orgs.reset()
|
||||
|
||||
print('\nCreating an org called "test_org"')
|
||||
test_org = modpol.instance:add_org('test_org', 'luke')
|
||||
|
||||
print('\nAdding user "nathan" to test_org')
|
||||
test_org:add_member('nathan')
|
||||
|
||||
print("\nOkay, let's start with requests. Setting up an org...")
|
||||
modpol.instance:add_org('test_org', 'luke')
|
||||
test_org:add_member('nathan')
|
||||
|
||||
print('\nMaking consent the add_member policy')
|
||||
test_org:set_policy("add_member", "consent", false);
|
||||
|
||||
print('\nMaking a request to add Josh')
|
||||
add_josh = {
|
||||
user = "josh",
|
||||
type = "add_member",
|
||||
params = {"josh"}
|
||||
}
|
||||
request_id = test_org:make_request(add_josh)
|
||||
|
||||
|
||||
print('\nHave the two members vote on it')
|
||||
modpol.interactions.org_dashboard("nathan","test_org")
|
||||
modpol.interactions.org_dashboard("luke","test_org")
|
||||
|
||||
13
modpol/tests/nested_module_test.lua
Normal file
13
modpol/tests/nested_module_test.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
dofile('../modpol.lua');
|
||||
|
||||
modpol.orgs.reset()
|
||||
|
||||
test_org = modpol.instance:add_org('test_org', 'luke')
|
||||
test_org:add_member('nathan')
|
||||
|
||||
print(table.concat(test_org:list_members(), ", "))
|
||||
|
||||
test_org:call_module(
|
||||
"join_org_consent",
|
||||
"paul"
|
||||
)
|
||||
Reference in New Issue
Block a user