Skip to content

Commit

Permalink
Merge pull request #634 from kiyonlin/add-render-tc
Browse files Browse the repository at this point in the history
📗 improve ctx.Render test
  • Loading branch information
Fenny authored Jul 18, 2020
2 parents eb11794 + 761532a commit 55d0fe1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ctx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
"text/template"
"time"

"github.com/valyala/bytebufferpool"

utils "github.com/gofiber/utils"
fasthttp "github.com/valyala/fasthttp"
)
Expand Down Expand Up @@ -1414,6 +1416,11 @@ func Test_Ctx_Render(t *testing.T) {
err := ctx.Render("./.github/TEST_DATA/template.html", Map{
"Title": "Hello, World!",
})

buf := bytebufferpool.Get()
_, _ = buf.WriteString("overwrite")
defer bytebufferpool.Put(buf)

utils.AssertEqual(t, nil, err)
utils.AssertEqual(t, "<h1>Hello, World!</h1>", string(ctx.Fasthttp.Response.Body()))

Expand Down

0 comments on commit 55d0fe1

Please sign in to comment.