Add route to get a particular book
This commit is contained in:
@@ -3,7 +3,7 @@ package main
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
@@ -44,7 +44,7 @@ func testSearchBook(t *testing.T, searchterm string) []bookSearchGet {
|
||||
var books []bookSearchGet
|
||||
err := json.Unmarshal(w.Body.Bytes(), &books)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
t.Error(err)
|
||||
}
|
||||
assert.Equal(t, 200, w.Code)
|
||||
return books
|
||||
|
||||
Reference in New Issue
Block a user