Test that the render response is as expected.
(t *testing.T)
| 25 | |
| 26 | // Test that the render response is as expected. |
| 27 | func TestBenchmarkRender(t *testing.T) { |
| 28 | startFakeBookingApp() |
| 29 | resp := httptest.NewRecorder() |
| 30 | c := NewTestController(resp, showRequest) |
| 31 | if err := c.SetAction("Hotels", "Show"); err != nil { |
| 32 | t.Errorf("SetAction failed: %s", err) |
| 33 | } |
| 34 | result := Hotels{c}.Show(3) |
| 35 | result.Apply(c.Request, c.Response) |
| 36 | if !strings.Contains(resp.Body.String(), "300 Main St.") { |
| 37 | t.Errorf("Failed to find hotel address in action response:\n%s", resp.Body) |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | func BenchmarkRenderChunked(b *testing.B) { |
| 42 | startFakeBookingApp() |
nothing calls this directly
no test coverage detected