| 466 | } |
| 467 | |
| 468 | func TestJSONCreate204(t *testing.T) { |
| 469 | is := is.New(t) |
| 470 | ctx := context.Background() |
| 471 | dir := t.TempDir() |
| 472 | td := testdir.New(dir) |
| 473 | td.Files["controller/controller.go"] = ` |
| 474 | package controller |
| 475 | type Controller struct {} |
| 476 | func (c *Controller) Create() {} |
| 477 | ` |
| 478 | is.NoErr(td.Write(ctx)) |
| 479 | cli := testcli.New(dir) |
| 480 | app, err := cli.Start(ctx, "run") |
| 481 | is.NoErr(err) |
| 482 | defer app.Close() |
| 483 | res, err := app.PostJSON("/", nil) |
| 484 | is.NoErr(err) |
| 485 | is.NoErr(res.Diff(` |
| 486 | HTTP/1.1 204 No Content |
| 487 | `)) |
| 488 | is.NoErr(app.Close()) |
| 489 | } |
| 490 | |
| 491 | func TestJSONCreate500(t *testing.T) { |
| 492 | is := is.New(t) |