MCPcopy
hub / github.com/benbjohnson/wtf / MustCreateUser

Function MustCreateUser

cmd/wtfd/main_test.go:48–54  ·  view source on GitHub ↗

MustCreateUser is a test helper for creating a new user in the system by calling the underlying DB service directly.

(tb testing.TB, m *main.Main, user *wtf.User)

Source from the content-addressed store, hash-verified

46// MustCreateUser is a test helper for creating a new user in the system by
47// calling the underlying DB service directly.
48func MustCreateUser(tb testing.TB, m *main.Main, user *wtf.User) (*wtf.User, context.Context) {
49 tb.Helper()
50 if err := m.UserService.CreateUser(context.Background(), user); err != nil {
51 tb.Fatal(err)
52 }
53 return user, wtf.NewContextWithUser(context.Background(), user)
54}
55
56// Login returns a Chrome action that generates a secure cookie and attaches it
57// to the browser. This approach is used to avoid OAuth communication with GitHub.

Callers 1

TestCreateDialFunction · 0.70

Calls 2

NewContextWithUserFunction · 0.92
CreateUserMethod · 0.65

Tested by

no test coverage detected