mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-25 01:40:30 +00:00
20 lines
602 B
Go
20 lines
602 B
Go
package permissions
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"go.woodpecker-ci.org/woodpecker/v2/server/model"
|
|
)
|
|
|
|
func TestOrgs(t *testing.T) {
|
|
o := NewOrgs([]string{"woodpecker-ci"})
|
|
assert.True(t, o.IsConfigured)
|
|
assert.True(t, o.IsMember([]*model.Team{{Login: "woodpecker-ci"}}))
|
|
assert.False(t, o.IsMember([]*model.Team{{Login: "not-woodpecker-ci"}}))
|
|
empty := NewOrgs([]string{})
|
|
assert.False(t, empty.IsConfigured)
|
|
assert.False(t, empty.IsMember([]*model.Team{{Login: "woodpecker-ci"}}))
|
|
assert.False(t, empty.IsMember([]*model.Team{{Login: "not-woodpecker-ci"}}))
|
|
}
|