org_req_test.lua 638 B

1234567891011121314151617181920212223242526
  1. dofile('../modpol.lua');
  2. modpol.orgs.reset()
  3. test_org = modpol.instance:add_org('test_org')
  4. test_org:add_member('luke')
  5. test_org:add_member('nathan')
  6. test_org:set_policy("add_member", "consent", false);
  7. new_request = {
  8. user = "josh",
  9. type = "add_member",
  10. params = {"josh"}
  11. }
  12. request_id = test_org:make_request(new_request)
  13. -- process_id = test_org:create_process("consent", request_id)
  14. for id, process in ipairs(test_org.processes) do
  15. process:approve('luke', true)
  16. process:approve('nathan', true)
  17. end
  18. -- process = test_org.processes[process_id]
  19. -- process:approve("luke", true)
  20. -- process:approve("nathan", true)