wippper snapper

This commit is contained in:
Bel LaPointe
2024-02-20 08:32:50 -07:00
parent a1d9e30030
commit 18d64d328c
2 changed files with 66 additions and 10 deletions

View File

@@ -81,7 +81,7 @@ func TestRunHTTP(t *testing.T) {
t.Errorf("not impl: %s", w.Body.Bytes())
})
t.Run("/api/v1/answers", func(t *testing.T) {
t.Run("GET /api/v1/answers", func(t *testing.T) {
r := httptest.NewRequest(http.MethodGet, "/api/v1/answers", nil)
r.SetBasicAuth("b", "b")
w := httptest.NewRecorder()
@@ -93,6 +93,19 @@ func TestRunHTTP(t *testing.T) {
}
t.Errorf("not impl: %s", w.Body.Bytes())
})
t.Run("POST /api/v1/answers", func(t *testing.T) {
r := httptest.NewRequest(http.MethodPost, "/api/v1/answers", nil)
r.SetBasicAuth("b", "b")
w := httptest.NewRecorder()
t.Logf("%s %s", r.Method, r.URL)
h.ServeHTTP(w, r)
t.Logf("(%d) %s", w.Code, w.Body.Bytes())
if w.Code != http.StatusNotFound {
t.Error(w.Code)
}
t.Errorf("not impl: %s", w.Body.Bytes())
})
}
func TestPublic(t *testing.T) {