aboutsummaryrefslogtreecommitdiffstats
path: root/commands/user_create_test.go
diff options
context:
space:
mode:
authorSteve Moyer <smoyer1@selesy.com>2022-05-27 13:39:16 -0400
committerSteve Moyer <smoyer1@selesy.com>2022-05-27 13:39:16 -0400
commit50324b8a7c23d5f68246af05e59024278e199148 (patch)
tree0bad22b1ca826f2d225a5451c3e4e372a06ed1b4 /commands/user_create_test.go
parent5962ed8453c07ff824a6935883b648cd642c4d2a (diff)
downloadgit-bug-50324b8a7c23d5f68246af05e59024278e199148.tar.gz
test(778): verify user create results in an identity and cache
Diffstat (limited to 'commands/user_create_test.go')
-rw-r--r--commands/user_create_test.go37
1 files changed, 37 insertions, 0 deletions
diff --git a/commands/user_create_test.go b/commands/user_create_test.go
new file mode 100644
index 00000000..c2e2398f
--- /dev/null
+++ b/commands/user_create_test.go
@@ -0,0 +1,37 @@
+package commands_test
+
+import (
+ "path/filepath"
+ "strings"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+)
+
+func newTestEnvAndUser(t *testing.T) (*testEnv, string) {
+ t.Helper()
+
+ testEnv := newTestEnv(t)
+
+ testEnv.cmd.SetArgs(
+ []string{
+ "user",
+ "create",
+ "--non-interactive",
+ "-n John Doe",
+ "-e jdoe@example.com",
+ })
+
+ testEnv.Execute(t)
+
+ return testEnv, strings.TrimSpace(testEnv.out.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"))
+}