Update the tests for Metadata.get_author_book action.
This commit is contained in:
@@ -202,7 +202,7 @@ defmodule DecentralisedBookIndex.Metadata.BookTest do
|
|||||||
%{order: 1, author_id: author.id, role: ""}
|
%{order: 1, author_id: author.id, role: ""}
|
||||||
]
|
]
|
||||||
|
|
||||||
{:ok, _book} =
|
{:ok, book} =
|
||||||
Metadata.create_book(
|
Metadata.create_book(
|
||||||
"Book",
|
"Book",
|
||||||
"An description",
|
"An description",
|
||||||
@@ -218,7 +218,10 @@ defmodule DecentralisedBookIndex.Metadata.BookTest do
|
|||||||
actor: user
|
actor: user
|
||||||
)
|
)
|
||||||
|
|
||||||
assert {:ok, _books} = Metadata.get_author_books(author)
|
assert {:ok, books} = Metadata.get_author_books(author)
|
||||||
|
|
||||||
|
book_ids = Enum.map(books.results, & &1.id)
|
||||||
|
assert book.id in book_ids
|
||||||
end
|
end
|
||||||
|
|
||||||
test "get the list contains aliases' books", %{user: user} do
|
test "get the list contains aliases' books", %{user: user} do
|
||||||
@@ -248,7 +251,7 @@ defmodule DecentralisedBookIndex.Metadata.BookTest do
|
|||||||
|
|
||||||
assert {:ok, books} = Metadata.get_author_books(author)
|
assert {:ok, books} = Metadata.get_author_books(author)
|
||||||
|
|
||||||
book_ids = Enum.map(books, & &1.id)
|
book_ids = Enum.map(books.results, & &1.id)
|
||||||
|
|
||||||
assert book.id in book_ids
|
assert book.id in book_ids
|
||||||
assert book2.id in book_ids
|
assert book2.id in book_ids
|
||||||
|
|||||||
Reference in New Issue
Block a user