Fix exported test function

This commit is contained in:
Javier Provecho Fernandez 2015-10-02 12:39:25 +02:00
parent 4892650ef8
commit fe49f0b616

View File

@ -239,14 +239,14 @@ func TestContextPostFormMultipart(t *testing.T) {
} }
func TestContextSetCookie(t *testing.T) { func TestContextSetCookie(t *testing.T) {
c, _, _ := createTestContext() c, _, _ := CreateTestContext()
c.SetCookie("user", "gin", 1, "/", "localhost", true, true) c.SetCookie("user", "gin", 1, "/", "localhost", true, true)
c.Request, _ = http.NewRequest("GET", "/set", nil) c.Request, _ = http.NewRequest("GET", "/set", nil)
assert.Equal(t, c.Writer.Header().Get("Set-Cookie"), "user=gin; Path=/; Domain=localhost; Max-Age=1; HttpOnly; Secure") assert.Equal(t, c.Writer.Header().Get("Set-Cookie"), "user=gin; Path=/; Domain=localhost; Max-Age=1; HttpOnly; Secure")
} }
func TestContextGetCookie(t *testing.T) { func TestContextGetCookie(t *testing.T) {
c, _, _ := createTestContext() c, _, _ := CreateTestContext()
c.Request, _ = http.NewRequest("GET", "/get", nil) c.Request, _ = http.NewRequest("GET", "/get", nil)
c.Request.Header.Set("Cookie", "user=gin") c.Request.Header.Set("Cookie", "user=gin")
cookie, _ := c.GetCookie("user") cookie, _ := c.GetCookie("user")