diff options
Diffstat (limited to 'tests/unit.c')
| -rw-r--r-- | tests/unit.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/unit.c b/tests/unit.c index 5932d46..0d21ee3 100644 --- a/tests/unit.c +++ b/tests/unit.c @@ -490,8 +490,13 @@ static void test_scope_edges(void) CHECK_INT(rc, 0); expect_allow(&p, "bob", "team", LV_WRITE, "refs/heads/dev"); expect_allow(&p, "bob", "team", LV_FORCE, "refs/heads/feature/x"); - expect_deny(&p, "bob", "team", LV_FORCE, "refs/heads/dev", "has force on team"); - expect_deny(&p, "bob", "team", LV_WRITE, "refs/heads/other", "needs write"); + /* A refusal names the level held on the ref in question, not the strongest + * level held somewhere in the repository: "you have force here" next to a + * refusal is a sentence nobody can act on. */ + expect_deny(&p, "bob", "team", LV_FORCE, "refs/heads/dev", + "bob has write on team refs/heads/dev; it needs force"); + expect_deny(&p, "bob", "team", LV_WRITE, "refs/heads/other", + "nothing at all on refs/heads/other"); policy_free(&p); /* per-repository protection replaces the global list, it does not add to it */ |
