MCPcopy Index your code
hub / github.com/dnote/dnote / TestCreateUser_ProValue

Function TestCreateUser_ProValue

pkg/server/app/users_test.go:64–80  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

62}
63
64func TestCreateUser_ProValue(t *testing.T) {
65 db := testutils.InitMemoryDB(t)
66
67 a := NewTest()
68 a.DB = db
69 if _, err := a.CreateUser("alice@example.com", "pass1234", "pass1234"); err != nil {
70 t.Fatal(errors.Wrap(err, "executing"))
71 }
72
73 var userCount int64
74 var userRecord database.User
75 testutils.MustExec(t, db.Model(&database.User{}).Count(&userCount), "counting user")
76 testutils.MustExec(t, db.First(&userRecord), "finding user")
77
78 assert.Equal(t, userCount, int64(1), "book count mismatch")
79
80}
81
82func TestGetUserByEmail(t *testing.T) {
83 t.Run("success", func(t *testing.T) {

Callers

nothing calls this directly

Calls 5

InitMemoryDBFunction · 0.92
MustExecFunction · 0.92
EqualFunction · 0.92
NewTestFunction · 0.85
CreateUserMethod · 0.80

Tested by

no test coverage detected