()
| 70 | } |
| 71 | |
| 72 | func (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 | |
| 87 | func (ts *UserTestSuite) TestUserUpdateEmail() { |
| 88 | cases := []struct { |
nothing calls this directly
no test coverage detected