Commit e0554eb3 authored by Karen Konou's avatar Karen Konou

Preload image assoc after updating user

parent aa63005a
......@@ -93,7 +93,7 @@ defmodule MoodleNet.Accounts do
# FIXME
actor =
ActivityPub.reload(actor)
|> Query.preload_assoc([:icon, :location, :attachment])
|> Query.preload_assoc([:icon, :image, :location, :attachment])
{:ok, actor}
end
......
......@@ -99,10 +99,12 @@ defmodule MoodleNet.AccountsTest do
locale: "fr",
primary_language: "cz",
summary: "summary",
image: "https://images.unsplash.com/flagged/photo-1551255868-86bbc8e0f971",
location: nil,
website: nil
}
assert {:ok, actor} = MoodleNet.Accounts.update_user(actor, attrs)
assert [%{url: ["https://images.unsplash.com/flagged/photo-1551255868-86bbc8e0f971"]}] = 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