|
|
|
@ -8,7 +8,7 @@ defmodule DecentralisedBookIndex.Sync.DataTransformers.AuthorTransformerTest do
|
|
|
|
|
test "a json contains correct author information" do
|
|
|
|
|
json_body = %{
|
|
|
|
|
"data" => %{
|
|
|
|
|
"attributes" => %{"description" => "Something", "name" => "Author"},
|
|
|
|
|
"attributes" => %{"description" => "Something", "name" => "Author", "avatar_url" => "/images/avatar.png"},
|
|
|
|
|
"id" => "889a323e-d104-4b5d-b276-dad5a9b1da9d",
|
|
|
|
|
"links" => %{},
|
|
|
|
|
"meta" => %{},
|
|
|
|
@ -26,13 +26,14 @@ defmodule DecentralisedBookIndex.Sync.DataTransformers.AuthorTransformerTest do
|
|
|
|
|
assert %{
|
|
|
|
|
id: "889a323e-d104-4b5d-b276-dad5a9b1da9d",
|
|
|
|
|
name: "Author",
|
|
|
|
|
description: "Something"
|
|
|
|
|
description: "Something",
|
|
|
|
|
avatar_url: "/images/avatar.png"
|
|
|
|
|
} = author
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
test "a json doesn't contains author information \"data\" attribute" do
|
|
|
|
|
json_body = %{
|
|
|
|
|
"attributes" => %{"description" => "Something", "name" => "Author"},
|
|
|
|
|
"attributes" => %{"description" => "Something", "name" => "Author", "avatar_url" => "/images/avatar.png"},
|
|
|
|
|
"id" => "889a323e-d104-4b5d-b276-dad5a9b1da9d",
|
|
|
|
|
"links" => %{},
|
|
|
|
|
"meta" => %{},
|
|
|
|
@ -44,7 +45,8 @@ defmodule DecentralisedBookIndex.Sync.DataTransformers.AuthorTransformerTest do
|
|
|
|
|
assert %{
|
|
|
|
|
id: "889a323e-d104-4b5d-b276-dad5a9b1da9d",
|
|
|
|
|
name: "Author",
|
|
|
|
|
description: "Something"
|
|
|
|
|
description: "Something",
|
|
|
|
|
avatar_url: "/images/avatar.png"
|
|
|
|
|
} = author
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|