From 14665df4396be8435022bf8f7caab5ff8815573e Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Mon, 6 Mar 2023 16:35:14 +0100 Subject: [PATCH] Better test array --- internal/auth/auth_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/auth/auth_test.go b/internal/auth/auth_test.go index a83ac30..81aa4eb 100644 --- a/internal/auth/auth_test.go +++ b/internal/auth/auth_test.go @@ -71,20 +71,20 @@ func TestHasNotRole(t *testing.T) { func TestHasAnyRole(t *testing.T) { u := User{Username: "testuser", Roles: []string{"user", "manager"}} - result := u.HasAnyRole([]Role{RoleManager, RoleSupport}) + result := u.HasAnyRole([]Role{RoleManager, RoleSupport, RoleAdmin}) if !result { - t.Fatalf(`User{Roles: ["user", "manager"]} -> HasAnyRole([]Role{RoleManager, RoleSupport}): RESULT = %v, expected 'true'.`, result) + t.Fatalf(`User{Roles: ["user", "manager"]} -> HasAnyRole([]Role{RoleManager, RoleSupport, RoleAdmin}): RESULT = %v, expected 'true'.`, result) } } func TestHasNotAnyRole(t *testing.T) { u := User{Username: "testuser", Roles: []string{"user", "manager"}} - result := u.HasAnyRole([]Role{RoleSupport}) + result := u.HasAnyRole([]Role{RoleSupport, RoleAdmin}) if result { - t.Fatalf(`User{Roles: ["user", "manager"]} -> HasAllRoles([]Role{RoleSupport}): RESULT = %v, expected 'false'.`, result) + t.Fatalf(`User{Roles: ["user", "manager"]} -> HasAllRoles([]Role{RoleSupport, RoleAdmin}): RESULT = %v, expected 'false'.`, result) } }