|
|
@ -14,7 +14,7 @@ defmodule DecentralisedBookIndex.Sync.ApiClients.FetchJsonsTest do
|
|
|
|
Metadata.create_author!("Author#{number}", "An description#{number}")
|
|
|
|
Metadata.create_author!("Author#{number}", "An description#{number}")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
assert {:ok, records} = FetchJsons.get("#{@test_server_endpoint}/api/v1/json/author")
|
|
|
|
assert {:ok, records} = FetchJsons.get("#{@test_server_endpoint}/api/v1/json/authors")
|
|
|
|
assert length(records) == 11
|
|
|
|
assert length(records) == 11
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -28,7 +28,7 @@ defmodule DecentralisedBookIndex.Sync.ApiClients.FetchJsonsTest do
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
assert {:ok, records} =
|
|
|
|
assert {:ok, records} =
|
|
|
|
FetchJsons.get("#{@test_server_endpoint}/api/v1/json/author", get_author_names)
|
|
|
|
FetchJsons.get("#{@test_server_endpoint}/api/v1/json/authors", get_author_names)
|
|
|
|
|
|
|
|
|
|
|
|
assert length(records) == 11
|
|
|
|
assert length(records) == 11
|
|
|
|
assert Enum.all?(records, fn author -> String.contains?(author, "Author") end)
|
|
|
|
assert Enum.all?(records, fn author -> String.contains?(author, "Author") end)
|
|
|
|