Skip to content

Commit

Permalink
update testing.
Browse files Browse the repository at this point in the history
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Dec 21, 2016
1 parent 5196daa commit ba668c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions multitemplate_test.go
Expand Up @@ -18,7 +18,7 @@ func performRequest(r http.Handler, method, path string) *httptest.ResponseRecor

func createMyRender() Render {
r := New()
r.AddFromFiles("index", "tests/base.html")
r.AddFromFiles("index", "tests/base.html", "tests/article.html")

return r
}
Expand All @@ -34,5 +34,5 @@ func TestAddFromFiles(t *testing.T) {

w := performRequest(router, "GET", "/")
assert.Equal(t, 200, w.Code)
assert.Equal(t, "<p>Test Multiple Template</p>\n", w.Body.String())
assert.Equal(t, "<p>Test Multiple Template</p>\nHi, this is article template\n", w.Body.String())
}
1 change: 1 addition & 0 deletions tests/article.html
@@ -0,0 +1 @@
{{define "article.html"}}Hi, this is article template{{end}}
1 change: 1 addition & 0 deletions tests/base.html
@@ -1 +1,2 @@
<p>{{ .title }}</p>
{{template "article.html"}}

0 comments on commit ba668c0

Please sign in to comment.