Add an action to add author to relative author's alias registry.
This commit is contained in:
@@ -14,5 +14,19 @@ defmodule DecentralisedBookIndex.Metadata.AuthorTest do
|
||||
assert {:ok, author} = Metadata.create_author("Author", "An description", registry.id)
|
||||
assert author.author_alias_registry_id == registry.id
|
||||
end
|
||||
|
||||
test "a new author to a registry via a related author record" do
|
||||
{:ok, related_author} = Metadata.create_author("Author", "An description")
|
||||
|
||||
assert {:ok, author} =
|
||||
Metadata.add_author_to_related_alias_registry("Author2", "An description2", related_author.id)
|
||||
|
||||
assert related_author.author_alias_registry_id == author.author_alias_registry_id
|
||||
end
|
||||
|
||||
test "a new author to a registry via a empty related author record" do
|
||||
assert {:error, _} =
|
||||
Metadata.add_author_to_related_alias_registry("Author2", "An description2", nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user