author is now on separate table

This commit is contained in:
2025-11-24 23:55:41 +01:00
parent fa49f276fe
commit 3cbe9f909e
9 changed files with 166 additions and 54 deletions

View File

@@ -11,11 +11,20 @@ import (
"github.com/stretchr/testify/assert"
)
func TestPostBookHandler_Ok(t *testing.T) {
func TestPostBookHandler_OkAuthorExist(t *testing.T) {
bookJson :=
`{
"title": "Le château",
"author": "Kafka"
"title": "Le Procès",
"author": "Franz Kafka"
}`
testPostBookHandler(t, bookJson, 200)
}
func TestPostBookHandler_OkNewAuthor(t *testing.T) {
bookJson :=
`{
"title": "Le joueur d'échecs",
"author": "Stefan Zweig"
}`
testPostBookHandler(t, bookJson, 200)
}
@@ -23,7 +32,7 @@ func TestPostBookHandler_Ok(t *testing.T) {
func TestPostBookHandler_OkOnlyTitle(t *testing.T) {
bookJson :=
`{
"title": "Le château"
"title": "Le Procès"
}`
testPostBookHandler(t, bookJson, 200)
}