Skip to content

Commit

Permalink
ajust config.Next position
Browse files Browse the repository at this point in the history
  • Loading branch information
tianjipeng committed Jan 26, 2021
1 parent daf5749 commit 7aede04
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions middleware/cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,11 @@ func Test_Cache_CustomNext(t *testing.T) {
utils.AssertEqual(t, true, bytes.Equal(body, bodyCached))
utils.AssertEqual(t, true, respCached.Header.Get(fiber.HeaderCacheControl) != "")

errResp, err := app.Test(httptest.NewRequest("GET", "/error", nil))
utils.AssertEqual(t, nil, err)
errBody, err := ioutil.ReadAll(errResp.Body)
_, err = app.Test(httptest.NewRequest("GET", "/error", nil))
utils.AssertEqual(t, nil, err)

errRespCached, err := app.Test(httptest.NewRequest("GET", "/error", nil))
utils.AssertEqual(t, nil, err)
errBodyCached, err := ioutil.ReadAll(errRespCached.Body)
utils.AssertEqual(t, nil, err)
utils.AssertEqual(t, false, bytes.Equal(errBody, errBodyCached))
utils.AssertEqual(t, true, errRespCached.Header.Get(fiber.HeaderCacheControl) == "")
}

Expand Down

0 comments on commit 7aede04

Please sign in to comment.