title: HTTPTest in Go - no body returning with Echo
body: <p>I'm trying to test a handler in Go using Echo. Here is the handler:</p>
  <pre><code>func submitted(c echo.Context) error {
      // do stuff with JSON here
      return c.Render(http.StatusOK, &quot;submitted&quot;, &quot;true&quot;)
  }
  </code></pre>
  <p>and the test:</p>
  <pre><code>import (
      &quot;testing&quot;
      &quot;net/http/httptest&quot;
      &quot;net/http&quot;
      &quot;github.com/labstack/echo&quot;
      &quot;strings&quot;
      &quot;fmt&quot;
      &quot;html/template&quot;
  )
  
  var userJSON = `{&lt;values go here&gt;}`
  
  func TestFunction(t *testing.T) {
      te := &amp;Template{
          templates: template.Must(template.ParseGlob(&quot;public/views/*.html&quot;)),
      }
      e := echo.New()
      e.Renderer = te
      req := httptest.NewRequest(http.MethodPost, &quot;/submitted&quot;, strings.NewReader(userJSON))
      req.Header.Set(echo.HeaderContentType, echo.MIMEApplicationJSON)
      rec := httptest.NewRecorder()
      c := e.NewContext(req, rec)
      fmt.Println(rec.Body.String())
  }
  </code></pre>
  <p>However, no body is returned it seems - even though the handler returns submitted.html file when running regularly. Any ideas?</p>