Rating a book will now remove it from the list
This commit is contained in:
@@ -33,6 +33,19 @@ func TestPutRatingUserBooksHandler_RateNewBookMakeItRead(t *testing.T) {
|
||||
assert.Equal(t, false, book.WantRead)
|
||||
}
|
||||
|
||||
func TestPutRatingUserBooksHandler_RateWantedBook(t *testing.T) {
|
||||
payload :=
|
||||
`{
|
||||
"rating": 6
|
||||
}`
|
||||
bookId := "2"
|
||||
testPutRateUserBooks(t, payload, bookId, http.StatusOK)
|
||||
book := testGetBook(t, bookId, http.StatusOK)
|
||||
assert.Equal(t, 6, book.Rating)
|
||||
assert.Equal(t, true, book.Read)
|
||||
assert.Equal(t, false, book.WantRead)
|
||||
}
|
||||
|
||||
func TestPutRatingUserBooksHandler_RatingTypeWrong(t *testing.T) {
|
||||
payload :=
|
||||
`{
|
||||
|
||||
Reference in New Issue
Block a user