X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fuser_test.exs;h=44763daf70bcf544c273dea4866693b3444b6495;hb=e1e0d5d75922c0e6738d97963f0df5ed4327d253;hp=195df2a03047231e9a95325af57ebe9306825565;hpb=9deae8c533f1579f3491df41ab08697e9c6589b6;p=akkoma diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs index 195df2a03..44763daf7 100644 --- a/test/pleroma/user_test.exs +++ b/test/pleroma/user_test.exs @@ -968,6 +968,25 @@ defmodule Pleroma.UserTest do assert user.last_refreshed_at == orig_user.last_refreshed_at end + + test "it doesn't fail on invalid alsoKnownAs entries" do + Tesla.Mock.mock(fn + %{url: "https://mbp.example.com/"} -> + %Tesla.Env{ + status: 200, + body: + "test/fixtures/microblogpub/user_with_invalid_also_known_as.json" + |> File.read!(), + headers: [{"content-type", "application/activity+json"}] + } + + _ -> + %Tesla.Env{status: 404} + end) + + assert {:ok, %User{also_known_as: []}} = + User.get_or_fetch_by_ap_id("https://mbp.example.com/") + end end test "returns an ap_id for a user" do