aboutsummaryrefslogtreecommitdiffstats
path: root/commands/user_create_test.go
diff options
context:
space:
mode:
authorSteve Moyer <smoyer1@selesy.com>2022-06-15 10:47:16 -0400
committerGitHub <noreply@github.com>2022-06-15 10:47:16 -0400
commitf80910891e4fdb7f03d7993da25e48ccdecaecb7 (patch)
treecc35ba90cc26f8bb1280e08d9899059da01e00f8 /commands/user_create_test.go
parentb33c1d42fc460467dd4801b9eed9fc689d79c040 (diff)
parentd853a6fbc996762ab264452150558bb92bdbd6fc (diff)
downloadgit-bug-f80910891e4fdb7f03d7993da25e48ccdecaecb7.tar.gz
Merge pull request #808 from selesy/fix/778-git-bug-rm-broken
fix(778): git bug rm broken
Diffstat (limited to 'commands/user_create_test.go')
-rw-r--r--commands/user_create_test.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/commands/user_create_test.go b/commands/user_create_test.go
new file mode 100644
index 00000000..223e7ec3
--- /dev/null
+++ b/commands/user_create_test.go
@@ -0,0 +1,36 @@
+package commands
+
+import (
+ "path/filepath"
+ "strings"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+)
+
+func newTestEnvAndUser(t *testing.T) (*testEnv, string) {
+ t.Helper()
+
+ testEnv := newTestEnv(t)
+
+ opts := createUserOptions{
+ name: "John Doe",
+ email: "jdoe@example.com",
+ avatarURL: "",
+ nonInteractive: true,
+ }
+
+ require.NoError(t, runUserCreate(testEnv.env, opts))
+
+ userID := strings.TrimSpace(testEnv.out.String())
+ testEnv.out.Reset()
+
+ return testEnv, userID
+}
+
+func TestUserCreateCommand(t *testing.T) {
+ testEnv, userID := newTestEnvAndUser(t)
+
+ require.FileExists(t, filepath.Join(testEnv.cwd, ".git", "refs", "identities", userID))
+ require.FileExists(t, filepath.Join(testEnv.cwd, ".git", "git-bug", "identity-cache"))
+}