MCPcopy Create free account
hub / github.com/supabase/auth / TestUserGet

Method TestUserGet

internal/api/user_test.go:72–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70}
71
72func (ts *UserTestSuite) TestUserGet() {
73 u, err := models.FindUserByEmailAndAudience(ts.API.db, "test@example.com", ts.Config.JWT.Aud)
74 require.NoError(ts.T(), err, "Error finding user")
75 token := ts.generateAccessTokenAndSession(u)
76
77 require.NoError(ts.T(), err, "Error generating access token")
78
79 req := httptest.NewRequest(http.MethodGet, "http://localhost/user", nil)
80 req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token))
81
82 w := httptest.NewRecorder()
83 ts.API.handler.ServeHTTP(w, req)
84 require.Equal(ts.T(), http.StatusOK, w.Code)
85}
86
87func (ts *UserTestSuite) TestUserUpdateEmail() {
88 cases := []struct {

Callers

nothing calls this directly

Calls 5

SetMethod · 0.80
EqualMethod · 0.80
ServeHTTPMethod · 0.45

Tested by

no test coverage detected