(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func TestNoCache(t *testing.T) { |
| 16 | app := iris.New() |
| 17 | app.Get("/", cache.NoCache, func(ctx iris.Context) { |
| 18 | ctx.WriteString("no_cache") |
| 19 | }) |
| 20 | |
| 21 | // tests |
| 22 | e := httptest.New(t, app) |
| 23 | |
| 24 | r := e.GET("/").Expect().Status(httptest.StatusOK) |
| 25 | r.Body().IsEqual("no_cache") |
| 26 | r.Header(context.CacheControlHeaderKey).Equal(cache.CacheControlHeaderValue) |
| 27 | r.Header(cache.PragmaHeaderKey).Equal(cache.PragmaNoCacheHeaderValue) |
| 28 | r.Header(cache.ExpiresHeaderKey).Equal(cache.ExpiresNeverHeaderValue) |
| 29 | } |
| 30 | |
| 31 | func TestStaticCache(t *testing.T) { |
| 32 | // test change the time format, which is not recommended but can be done. |
nothing calls this directly
no test coverage detected
searching dependent graphs…