(t *testing.T)
| 86 | } |
| 87 | |
| 88 | func TestRender_HTML_CustomStatus(t *testing.T) { |
| 89 | dir := makeViewDir(t, map[string]string{ |
| 90 | "404.html": `<h1>Not Found</h1>`, |
| 91 | }) |
| 92 | |
| 93 | server := setupServer(t, dir) |
| 94 | server.Get("/missing", func(c *pine.Ctx) error { |
| 95 | return c.Render("404.html", nil, http.StatusNotFound) |
| 96 | }) |
| 97 | |
| 98 | req := httptest.NewRequest(http.MethodGet, "/missing", nil) |
| 99 | rr := httptest.NewRecorder() |
| 100 | server.ServeHTTP(rr, req) |
| 101 | |
| 102 | if rr.Code != http.StatusNotFound { |
| 103 | t.Errorf("expected 404, got %d", rr.Code) |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | func TestRender_HTML_SharedPartial(t *testing.T) { |
| 108 | dir := makeViewDir(t, map[string]string{ |
nothing calls this directly
no test coverage detected