Test that the render response is as expected.
(t *testing.T)
| 12 | |
| 13 | // Test that the render response is as expected. |
| 14 | func TestBenchmarkCompressed(t *testing.T) { |
| 15 | startFakeBookingApp() |
| 16 | resp := httptest.NewRecorder() |
| 17 | c := NewTestController(resp, showRequest) |
| 18 | if err := c.SetAction("Hotels", "Show"); err != nil { |
| 19 | t.Errorf("SetAction failed: %s", err) |
| 20 | } |
| 21 | Config.SetOption("results.compressed", "true") |
| 22 | result := Hotels{c}.Show(3) |
| 23 | result.Apply(c.Request, c.Response) |
| 24 | if !strings.Contains(resp.Body.String(), "300 Main St.") { |
| 25 | t.Errorf("Failed to find hotel address in action response:\n%s", resp.Body) |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | func BenchmarkRenderCompressed(b *testing.B) { |
| 30 | startFakeBookingApp() |
nothing calls this directly
no test coverage detected