test: add /swagger/ index.html response test for safety
This commit is contained in:
parent
48b8bcf40c
commit
8fa4cb2f77
|
|
@ -85,6 +85,11 @@ func TestWrapCustomHandler(t *testing.T) {
|
||||||
w := performRequest(http.MethodGet, "/swagger", router)
|
w := performRequest(http.MethodGet, "/swagger", router)
|
||||||
assert.Equal(t, http.StatusOK, w.Code)
|
assert.Equal(t, http.StatusOK, w.Code)
|
||||||
assert.Contains(t, w.Body.String(), "<title>Swagger UI</title>")
|
assert.Contains(t, w.Body.String(), "<title>Swagger UI</title>")
|
||||||
|
|
||||||
|
// Test: /swagger/ should also return index.html
|
||||||
|
wSlash := performRequest(http.MethodGet, "/swagger/", router)
|
||||||
|
assert.Equal(t, http.StatusOK, wSlash.Code)
|
||||||
|
assert.Contains(t, wSlash.Body.String(), "<title>Swagger UI</title>")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDisablingWrapHandler(t *testing.T) {
|
func TestDisablingWrapHandler(t *testing.T) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue