Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0efe72c

Browse files
committed
Add unit test
1 parent42b42ab commit0efe72c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

‎coderd/rbac/builtin_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package rbac_test
22

33
import (
4+
"fmt"
45
"testing"
56

67
"github.com/google/uuid"
@@ -60,3 +61,23 @@ func TestIsOrgRole(t *testing.T) {
6061
})
6162
}
6263
}
64+
65+
funcTestListRoles(t*testing.T) {
66+
t.Parallel()
67+
68+
// If this test is ever failing, just update the list to the roles
69+
// expected from the builtin set.
70+
require.ElementsMatch(t, []string{
71+
"admin",
72+
"member",
73+
"auditor",
74+
},
75+
rbac.SiteRoles())
76+
77+
orgID:=uuid.New()
78+
require.ElementsMatch(t, []string{
79+
fmt.Sprintf("organization-admin:%s",orgID.String()),
80+
fmt.Sprintf("organization-member:%s",orgID.String()),
81+
},
82+
rbac.OrganizationRoles(orgID))
83+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp