mirror of
https://github.com/kataras/iris.git
synced 2025-03-15 06:46:26 +01:00
Ok finish the context's tests
This commit is contained in:
parent
728cba60f7
commit
f5f7f22245
|
@ -66,9 +66,11 @@ type (
|
||||||
GetString(string) string
|
GetString(string) string
|
||||||
GetInt(string) int
|
GetInt(string) int
|
||||||
Set(string, interface{})
|
Set(string, interface{})
|
||||||
|
VisitAllCookies(func(string, string))
|
||||||
SetCookie(*fasthttp.Cookie)
|
SetCookie(*fasthttp.Cookie)
|
||||||
SetCookieKV(string, string)
|
SetCookieKV(string, string)
|
||||||
RemoveCookie(string)
|
RemoveCookie(string)
|
||||||
|
GetFlashes() map[string]string
|
||||||
GetFlash(string) (string, error)
|
GetFlash(string) (string, error)
|
||||||
SetFlash(string, string)
|
SetFlash(string, string)
|
||||||
Session() store.IStore
|
Session() store.IStore
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
package iris
|
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 (
|
import (
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
@ -308,6 +315,7 @@ func TestContextRedirectTo(t *testing.T) {
|
||||||
//println("Redirecting to: " + routeName + " with path: " + Path(routeName, args...))
|
//println("Redirecting to: " + routeName + " with path: " + Path(routeName, args...))
|
||||||
ctx.RedirectTo(routeName, args...)
|
ctx.RedirectTo(routeName, args...)
|
||||||
})
|
})
|
||||||
|
|
||||||
e := Tester(t)
|
e := Tester(t)
|
||||||
|
|
||||||
e.GET("/redirect/to/my-path/").Expect().Status(StatusOK).Body().Equal("/mypath")
|
e.GET("/redirect/to/my-path/").Expect().Status(StatusOK).Body().Equal("/mypath")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user