test "get_public_key_for_ap_id fetches a user that's not in the db" do
assert {:ok, _key} = User.get_public_key_for_ap_id("http://mastodon.example.org/users/admin")
end
+
+ test "insert or update a user from given data" do
+ user = insert(:user, %{nickname: "nick@name.de"})
+ data = %{ ap_id: user.ap_id <> "xxx", name: user.name, nickname: user.nickname }
+
+ assert {:ok, %User{}} = User.insert_or_update_user(data)
+ end
end