Get without id == trace since browsers dont support trace
This commit is contained in:
@@ -254,6 +254,23 @@ func TestWho(t *testing.T) {
|
||||
t.Logf("%+v", v)
|
||||
})
|
||||
|
||||
t.Run("get without id == trace real", func(t *testing.T) {
|
||||
r := httptest.NewRequest(http.MethodGet, "/who?namespace=col", nil)
|
||||
w := httptest.NewRecorder()
|
||||
handler.ServeHTTP(w, r)
|
||||
if w.Code != http.StatusOK {
|
||||
t.Fatalf("%d: %s", w.Code, w.Body.Bytes())
|
||||
}
|
||||
var v []string
|
||||
if err := json.Unmarshal(w.Body.Bytes(), &v); err != nil {
|
||||
t.Fatalf("%v: %s", err, w.Body.Bytes())
|
||||
}
|
||||
if len(v) < 5 {
|
||||
t.Fatal(len(v))
|
||||
}
|
||||
t.Logf("%+v", v)
|
||||
})
|
||||
|
||||
t.Run("trace real sorted asc/desc name", func(t *testing.T) {
|
||||
for _, order := range []string{"1", "-1"} {
|
||||
r := httptest.NewRequest(http.MethodTrace, "/who?namespace=col&sort=name&order="+order, nil)
|
||||
|
||||
Reference in New Issue
Block a user