Leverage existing atoms as return errors for the object fetcher

This commit is contained in:
Mark Felder 2023-12-27 21:57:47 -05:00
commit a2708f7fe3
4 changed files with 9 additions and 9 deletions

View file

@ -220,14 +220,14 @@ defmodule Pleroma.Object.FetcherTest do
end
test "handle HTTP 410 Gone response" do
assert {:error, "Object has been deleted"} ==
assert {:error, :not_found} ==
Fetcher.fetch_and_contain_remote_object_from_id(
"https://mastodon.example.org/users/userisgone"
)
end
test "handle HTTP 404 response" do
assert {:error, "Object has been deleted"} ==
assert {:error, :not_found} ==
Fetcher.fetch_and_contain_remote_object_from_id(
"https://mastodon.example.org/users/userisgone404"
)

View file

@ -137,7 +137,7 @@ defmodule Pleroma.Web.TwitterAPI.RemoteFollowControllerTest do
|> html_response(200)
assert response =~ "Error fetching user"
end) =~ "Object has been deleted"
end) =~ ":not_found"
end
end