Default DB configuration to false and set the default database name to
[akkoma] / test / object / fetcher_test.exs
index 58abcfe5522ac26414137988b4df9d547ca22c64..26dc9496deb5c609617d518c789912eaf9604a8d 100644 (file)
@@ -11,6 +11,9 @@ defmodule Pleroma.Object.FetcherTest do
       %{method: :get, url: "https://mastodon.example.org/users/userisgone"} ->
         %Tesla.Env{status: 410}
 
+      %{method: :get, url: "https://mastodon.example.org/users/userisgone404"} ->
+        %Tesla.Env{status: 404}
+
       env ->
         apply(HttpRequestMock, :request, [env])
     end)
@@ -100,6 +103,13 @@ defmodule Pleroma.Object.FetcherTest do
                  "https://mastodon.example.org/users/userisgone"
                )
     end
+
+    test "handle HTTP 404 response" do
+      assert {:error, "Object has been deleted"} ==
+               Fetcher.fetch_and_contain_remote_object_from_id(
+                 "https://mastodon.example.org/users/userisgone404"
+               )
+    end
   end
 
   describe "pruning" do