spec/util_roles_spec.lua
changeset 12758 a92ca737d05f
parent 12757 2eb02b32bb4c
equal deleted inserted replaced
12757:2eb02b32bb4c 12758:a92ca737d05f
    24 		it("has a sensible tostring", function ()
    24 		it("has a sensible tostring", function ()
    25 			local test_role_2 = roles.new({
    25 			local test_role_2 = roles.new({
    26 				id = "test-role-2";
    26 				id = "test-role-2";
    27 				name = "Test Role 2";
    27 				name = "Test Role 2";
    28 			});
    28 			});
    29 			assert.truthy(tostring(test_role_2):find("test-role-2", 1, true));
    29 			assert.truthy(tostring(test_role_2):find(test_role_2.id, 1, true));
    30 			assert.truthy(tostring(test_role_2):find("Test Role 2", 1, true));
    30 			assert.truthy(tostring(test_role_2):find("Test Role 2", 1, true));
    31 		end);
    31 		end);
    32 		it("is restrictive by default", function ()
    32 		it("is restrictive by default", function ()
    33 			assert.falsy(test_role:may("my-permission"));
    33 			assert.falsy(test_role:may("my-permission"));
    34 		end);
    34 		end);