parent
580d1d2d66
commit
f2f4990779
@ -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
|
Loading…
Reference in new issue