Update the JSON API endpoint to /authors for Author.
This commit is contained in:
@@ -11,7 +11,7 @@ defmodule DecentralisedBookIndex.Sync.ApiClients.FetchJsonTest do
|
||||
test "get an author" do
|
||||
{:ok, author} = Metadata.create_author("Author", "An description")
|
||||
|
||||
assert {:ok, data} = FetchJson.get("#{@test_server_endpoint}/api/v1/json/author/#{author.id}")
|
||||
assert {:ok, data} = FetchJson.get("#{@test_server_endpoint}/api/v1/json/authors/#{author.id}")
|
||||
assert data["data"]["id"] == author.id
|
||||
end
|
||||
end
|
||||
|
||||
@@ -14,7 +14,7 @@ defmodule DecentralisedBookIndex.Sync.ApiClients.FetchJsonsTest do
|
||||
Metadata.create_author!("Author#{number}", "An description#{number}")
|
||||
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
|
||||
end
|
||||
|
||||
@@ -28,7 +28,7 @@ defmodule DecentralisedBookIndex.Sync.ApiClients.FetchJsonsTest do
|
||||
end
|
||||
|
||||
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 Enum.all?(records, fn author -> String.contains?(author, "Author") end)
|
||||
|
||||
Reference in New Issue
Block a user