lavender/server/roles_test.go

13 lines
352 B
Go
Raw Normal View History

2024-02-07 01:18:17 +00:00
package server
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestHasRole(t *testing.T) {
assert.True(t, HasRole("lavender:admin test:something-else", "lavender:admin"))
assert.False(t, HasRole("lavender:admin,test:something-else", "lavender:admin"))
assert.False(t, HasRole("lavender: test:something-else", "lavender:admin"))
}