Merge branch 'feature/bump-elixir-verstion' into 'develop'
[akkoma] / test / object_test.exs
index a30efd48c7791cfca8c3c66040c2579f74188a39..ba96aeea4d67ba793e5181fc9b1844bdf7daaa8e 100644 (file)
@@ -5,9 +5,15 @@
 defmodule Pleroma.ObjectTest do
   use Pleroma.DataCase
   import Pleroma.Factory
+  import Tesla.Mock
   alias Pleroma.Object
   alias Pleroma.Repo
 
+  setup do
+    mock(fn env -> apply(HttpRequestMock, :request, [env]) end)
+    :ok
+  end
+
   test "returns an object by it's AP id" do
     object = insert(:note)
     found_object = Object.get_by_ap_id(object.data["id"])
@@ -47,9 +53,12 @@ defmodule Pleroma.ObjectTest do
 
       assert object == cached_object
 
+      Cachex.put(:web_resp_cache, URI.parse(object.data["id"]).path, "cofe")
+
       Object.delete(cached_object)
 
       {:ok, nil} = Cachex.get(:object_cache, "object:#{object.data["id"]}")
+      {:ok, nil} = Cachex.get(:web_resp_cache, URI.parse(object.data["id"]).path)
 
       cached_object = Object.get_cached_by_ap_id(object.data["id"])