Skip to content

Commit

Permalink
Add test for the new files
Browse files Browse the repository at this point in the history
  • Loading branch information
limistah committed Sep 6, 2023
1 parent 068d53d commit ee5ed54
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions swagger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ func TestWrapCustomHandler(t *testing.T) {
assert.Equal(t, http.StatusOK, w5.Code)
assert.Equal(t, w5.Header()["Content-Type"][0], "application/javascript")

w6 := performRequest(http.MethodGet, "/index.css", router)
assert.Equal(t, http.StatusOK, w6.Code)
assert.Equal(t, w6.Header()["Content-Type"][0], "text/css; charset=utf-8")

w7 := performRequest(http.MethodGet, "/swagger-initializer.js", router)
assert.Equal(t, http.StatusOK, w7.Code)
assert.Equal(t, w7.Header()["Content-Type"][0], "application/javascript")

assert.Equal(t, http.StatusNotFound, performRequest(http.MethodGet, "/notfound", router).Code)

assert.Equal(t, http.StatusMethodNotAllowed, performRequest(http.MethodPost, "/index.html", router).Code)
Expand Down

0 comments on commit ee5ed54

Please sign in to comment.