diff --git a/context/context.go b/context/context.go index 2116a83e..66650aa6 100644 --- a/context/context.go +++ b/context/context.go @@ -66,9 +66,11 @@ type ( GetString(string) string GetInt(string) int Set(string, interface{}) + VisitAllCookies(func(string, string)) SetCookie(*fasthttp.Cookie) SetCookieKV(string, string) RemoveCookie(string) + GetFlashes() map[string]string GetFlash(string) (string, error) SetFlash(string, string) Session() store.IStore diff --git a/context_test.go b/context_test.go index 0a4d3b9b..0907d59b 100644 --- a/context_test.go +++ b/context_test.go @@ -1,5 +1,12 @@ package iris +/* The most part of the context covered, +the other part contains serving static methods, +find remote ip and GetInt, +I am not waiting unexpected behaviors from the rest of the funcs, +so that's all with context's tests. +*/ + import ( "encoding/xml" "net/url" @@ -308,6 +315,7 @@ func TestContextRedirectTo(t *testing.T) { //println("Redirecting to: " + routeName + " with path: " + Path(routeName, args...)) ctx.RedirectTo(routeName, args...) }) + e := Tester(t) e.GET("/redirect/to/my-path/").Expect().Status(StatusOK).Body().Equal("/mypath")