1
0
mirror of https://github.com/gofiber/fiber.git synced 2025-02-27 15:03:59 +00:00
fiber/response_test.go
2020-02-06 03:50:13 +01:00

26 lines
512 B
Go

package fiber
import (
"net/http"
"strings"
"testing"
)
func Test_Append(t *testing.T) {
app := New()
app.Get("/test", func(c *Ctx) {
c.Append("X-Test", "hel")
c.Append("X-Test", "lo", "world")
})
req, _ := http.NewRequest("GET", "/test", nil)
res, err := app.Test(req)
if err != nil {
t.Fatalf(`%s: %s`, t.Name(), err)
}
if !strings.Contains(res, "X-Test: hel, lo, world") {
t.Fatalf(`%s: Expecting %s`, t.Name(), "X-Test: hel, lo, world")
}
}
// TODO: add all functions from response.go