Commit 4a67e4cc authored by Karen Konou's avatar Karen Konou

Set AS2 object type for images updated from nil

parent a5f4acb5
Pipeline #64762325 passed with stages
in 5 minutes and 10 seconds
......@@ -102,7 +102,7 @@ defmodule MoodleNet.Accounts do
defp update_image(image, url, actor) do
case image do
nil ->
with {:ok, image} <- ActivityPub.new(url: url),
with {:ok, image} <- ActivityPub.new(type: "Image", url: url),
{:ok, image} <- ActivityPub.insert(image),
{:ok, _} <- Alter.add(actor, :image, image),
do: {:ok, image}
......
......@@ -104,7 +104,7 @@ defmodule MoodleNet.AccountsTest do
website: nil
}
assert {:ok, actor} = MoodleNet.Accounts.update_user(actor, attrs)
assert [%{url: ["https://images.unsplash.com/flagged/photo-1551255868-86bbc8e0f971"]}] = actor.image
assert [%{url: ["https://images.unsplash.com/flagged/photo-1551255868-86bbc8e0f971"], type: ["Object", "Image"]}] = actor.image
assert actor.name == %{"und" => attrs.name}
assert actor.summary == %{"und" => attrs.summary}
assert actor.preferred_username == attrs.preferred_username
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment