Update the create action for Author to set AuthorAliasRegistry.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
defmodule DecentralisedBookIndex.Metadata.AuthorTest do
|
||||
use DecentralisedBookIndex.DataCase, async: true
|
||||
|
||||
alias DecentralisedBookIndex.Metadata
|
||||
|
||||
describe "authors and registries relationship" do
|
||||
test "a new author get new registry by default" do
|
||||
assert {:ok, author} = Metadata.create_author("Author", "An description")
|
||||
assert author.author_alias_registry_id != nil
|
||||
end
|
||||
|
||||
test "a new author belongs to a registry if specified" do
|
||||
assert {:ok, registry} = Metadata.create_author_alias_registry()
|
||||
assert {:ok, author} = Metadata.create_author("Author", "An description", registry.id)
|
||||
assert author.author_alias_registry_id == registry.id
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user