summaryrefslogtreecommitdiff
path: root/test/web/media_proxy/invalidations/http_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-06-20 09:33:18 +0000
committerlain <lain@soykaf.club>2020-06-20 09:33:18 +0000
commit7d542450b13742c6efa93246c172c8306e730d50 (patch)
tree86998336bba747f1ce605a1c06e39ac96f38b396 /test/web/media_proxy/invalidations/http_test.exs
parent4733f6a3371504ebb3eeb447d7c20d56c10b43bf (diff)
parentf9282677731cca96a1316e2830507837535c06e0 (diff)
downloadpleroma-7d542450b13742c6efa93246c172c8306e730d50.tar.gz
pleroma-7d542450b13742c6efa93246c172c8306e730d50.zip
Merge branch 'develop' into '1865-media-only'
# Conflicts: # CHANGELOG.md
Diffstat (limited to 'test/web/media_proxy/invalidations/http_test.exs')
-rw-r--r--test/web/media_proxy/invalidations/http_test.exs12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/web/media_proxy/invalidations/http_test.exs b/test/web/media_proxy/invalidations/http_test.exs
index 8a3b4141c..a1bef5237 100644
--- a/test/web/media_proxy/invalidations/http_test.exs
+++ b/test/web/media_proxy/invalidations/http_test.exs
@@ -5,6 +5,10 @@ defmodule Pleroma.Web.MediaProxy.Invalidation.HttpTest do
import ExUnit.CaptureLog
import Tesla.Mock
+ setup do
+ on_exit(fn -> Cachex.clear(:banned_urls_cache) end)
+ end
+
test "logs hasn't error message when request is valid" do
mock(fn
%{method: :purge, url: "http://example.com/media/example.jpg"} ->
@@ -14,8 +18,8 @@ defmodule Pleroma.Web.MediaProxy.Invalidation.HttpTest do
refute capture_log(fn ->
assert Invalidation.Http.purge(
["http://example.com/media/example.jpg"],
- %{}
- ) == {:ok, "success"}
+ []
+ ) == {:ok, ["http://example.com/media/example.jpg"]}
end) =~ "Error while cache purge"
end
@@ -28,8 +32,8 @@ defmodule Pleroma.Web.MediaProxy.Invalidation.HttpTest do
assert capture_log(fn ->
assert Invalidation.Http.purge(
["http://example.com/media/example1.jpg"],
- %{}
- ) == {:ok, "success"}
+ []
+ ) == {:ok, ["http://example.com/media/example1.jpg"]}
end) =~ "Error while cache purge: url - http://example.com/media/example1.jpg"
end
end