aboutsummaryrefslogtreecommitdiffstats
path: root/commands/user_create_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/user_create_test.go')
-rw-r--r--commands/user_create_test.go21
1 files changed, 9 insertions, 12 deletions
diff --git a/commands/user_create_test.go b/commands/user_create_test.go
index 07ed657b..223e7ec3 100644
--- a/commands/user_create_test.go
+++ b/commands/user_create_test.go
@@ -1,4 +1,4 @@
-package commands_test
+package commands
import (
"path/filepath"
@@ -13,16 +13,15 @@ func newTestEnvAndUser(t *testing.T) (*testEnv, string) {
testEnv := newTestEnv(t)
- testEnv.cmd.SetArgs(
- []string{
- "user",
- "create",
- "--non-interactive",
- "-n John Doe",
- "-e jdoe@example.com",
- })
+ opts := createUserOptions{
+ name: "John Doe",
+ email: "jdoe@example.com",
+ avatarURL: "",
+ nonInteractive: true,
+ }
+
+ require.NoError(t, runUserCreate(testEnv.env, opts))
- testEnv.Execute(t)
userID := strings.TrimSpace(testEnv.out.String())
testEnv.out.Reset()
@@ -32,8 +31,6 @@ func newTestEnvAndUser(t *testing.T) (*testEnv, string) {
func TestUserCreateCommand(t *testing.T) {
testEnv, userID := newTestEnvAndUser(t)
- t.Log("CWD:", testEnv.cwd)
-
require.FileExists(t, filepath.Join(testEnv.cwd, ".git", "refs", "identities", userID))
require.FileExists(t, filepath.Join(testEnv.cwd, ".git", "git-bug", "identity-cache"))
}