From f5f7f22245cbb73ffc6f9ab0cd48331274a00b03 Mon Sep 17 00:00:00 2001 From: Makis Maropoulos Date: Thu, 7 Jul 2016 01:26:05 +0200 Subject: [PATCH] Ok finish the context's tests --- context/context.go | 2 ++ context_test.go | 8 ++++++++ 2 files changed, 10 insertions(+) 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")