MCPcopy Index your code
hub / github.com/kataras/iris / TestNoCache

Function TestNoCache

cache/browser_test.go:15–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func 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
31func TestStaticCache(t *testing.T) {
32 // test change the time format, which is not recommended but can be done.

Callers

nothing calls this directly

Calls 8

NewFunction · 0.92
NewMethod · 0.80
WriteStringMethod · 0.80
StatusMethod · 0.80
GetMethod · 0.65
BodyMethod · 0.65
EqualMethod · 0.45
HeaderMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…