mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: remove CreateAnotherUserWithUser (#6068)
This was not idiomatic Go!
This commit is contained in:
+1
-1
@@ -87,7 +87,7 @@ func TestCreate(t *testing.T) {
|
||||
_ = coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
|
||||
cmd, root := clitest.New(t, "create", "my-workspace", "-y")
|
||||
|
||||
member := coderdtest.CreateAnotherUser(t, client, user.OrganizationID)
|
||||
member, _ := coderdtest.CreateAnotherUser(t, client, user.OrganizationID)
|
||||
clitest.SetupConfig(t, member, root)
|
||||
cmdCtx, done := context.WithTimeout(context.Background(), testutil.WaitLong)
|
||||
go func() {
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ func TestDelete(t *testing.T) {
|
||||
adminClient := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
|
||||
adminUser := coderdtest.CreateFirstUser(t, adminClient)
|
||||
orgID := adminUser.OrganizationID
|
||||
client := coderdtest.CreateAnotherUser(t, adminClient, orgID)
|
||||
client, _ := coderdtest.CreateAnotherUser(t, adminClient, orgID)
|
||||
user, err := client.User(context.Background(), codersdk.Me)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
||||
@@ -87,12 +87,9 @@ func TestUserShow(t *testing.T) {
|
||||
|
||||
t.Run("Table", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx := context.Background()
|
||||
client := coderdtest.New(t, nil)
|
||||
admin := coderdtest.CreateFirstUser(t, client)
|
||||
other := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
|
||||
otherUser, err := other.User(ctx, codersdk.Me)
|
||||
require.NoError(t, err, "fetch other user")
|
||||
_, otherUser := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
|
||||
cmd, root := clitest.New(t, "users", "show", otherUser.Username)
|
||||
clitest.SetupConfig(t, client, root)
|
||||
doneChan := make(chan struct{})
|
||||
@@ -114,7 +111,7 @@ func TestUserShow(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
client := coderdtest.New(t, nil)
|
||||
admin := coderdtest.CreateFirstUser(t, client)
|
||||
other := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
|
||||
other, _ := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
|
||||
otherUser, err := other.User(ctx, codersdk.Me)
|
||||
require.NoError(t, err, "fetch other user")
|
||||
cmd, root := clitest.New(t, "users", "show", otherUser.Username, "-o", "json")
|
||||
|
||||
@@ -17,7 +17,7 @@ func TestUserStatus(t *testing.T) {
|
||||
t.Parallel()
|
||||
client := coderdtest.New(t, nil)
|
||||
admin := coderdtest.CreateFirstUser(t, client)
|
||||
other := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
|
||||
other, _ := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
|
||||
otherUser, err := other.User(context.Background(), codersdk.Me)
|
||||
require.NoError(t, err, "fetch user")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user