acl
This commit is contained in:
@@ -422,3 +422,27 @@ func TestEffectiveMissingDocument(t *testing.T) {
|
||||
t.Fatalf("erreur = %v, attendu ErrDocumentNotFound", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsActive(t *testing.T) {
|
||||
service := newTestService(t)
|
||||
ctx := context.Background()
|
||||
alice := mustUser(t, service, "alice")
|
||||
|
||||
active, err := service.IsActive(ctx, alice.ID)
|
||||
if err != nil {
|
||||
t.Fatalf("IsActive : %v", err)
|
||||
}
|
||||
if !active {
|
||||
t.Fatal("alice devrait être active")
|
||||
}
|
||||
|
||||
disablePrincipal(t, service, alice.ID)
|
||||
|
||||
active, err = service.IsActive(ctx, alice.ID)
|
||||
if err != nil {
|
||||
t.Fatalf("IsActive après désactivation : %v", err)
|
||||
}
|
||||
if active {
|
||||
t.Fatal("alice ne devrait plus être active")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user