iam roles (#116)

This commit is contained in:
Jim authored and GitHub committed 2020-06-15 12:42:08 -04:00
1 parent 1637403624
commit ffddf24f86
14 files changed
+1671 -2

No files matched your search

+23 -1
View File
@@ -67,7 +67,6 @@ func Test_TestUser(t *testing.T) {
err = conn.Close()
assert.NoError(err)
}()
org, _ := TestScopes(t, conn)
require.NotNil(org)
@@ -77,3 +76,26 @@ func Test_TestUser(t *testing.T) {
require.NotNil(user)
assert.NotEmpty(user.PublicId)
}
func Test_TestRole(t *testing.T) {
t.Helper()
assert, require := assert.New(t), require.New(t)
cleanup, conn, _ := db.TestSetup(t, "postgres")
defer func() {
err := cleanup()
assert.NoError(err)
err = conn.Close()
assert.NoError(err)
}()
id := testId(t)
org, proj := TestScopes(t, conn)
role := TestRole(t, conn, org.PublicId, WithDescription(id), WithName(id))
require.NotNil(role)
assert.Equal(id, role.Description)
assert.Equal(id, role.Name)
assert.NotEmpty(role.PublicId)
projRole := TestRole(t, conn, proj.PublicId)
require.NotNil(projRole)
assert.NotEmpty(projRole.PublicId)
}