diff options
author | feld <feld@feld.me> | 2020-06-19 20:38:22 +0000 |
---|---|---|
committer | feld <feld@feld.me> | 2020-06-19 20:38:22 +0000 |
commit | f9282677731cca96a1316e2830507837535c06e0 (patch) | |
tree | 27e04af4e4fac3e4ed53a653bd1ec293f48410a3 /test/web/media_proxy/invalidations/script_test.exs | |
parent | 436bb0cd12825b3202a46dbc04cd063935e40344 (diff) | |
parent | 4044f24e2e4935757e038e7f06373ed1c9172560 (diff) | |
download | pleroma-f9282677731cca96a1316e2830507837535c06e0.tar.gz pleroma-f9282677731cca96a1316e2830507837535c06e0.zip |
Merge branch 'issue/1855' into 'develop'
#1855 MediaProxy cache invalidation via Admin API
See merge request pleroma/pleroma!2648
Diffstat (limited to 'test/web/media_proxy/invalidations/script_test.exs')
-rw-r--r-- | test/web/media_proxy/invalidations/script_test.exs | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/test/web/media_proxy/invalidations/script_test.exs b/test/web/media_proxy/invalidations/script_test.exs index 1358963ab..51833ab18 100644 --- a/test/web/media_proxy/invalidations/script_test.exs +++ b/test/web/media_proxy/invalidations/script_test.exs @@ -4,17 +4,23 @@ defmodule Pleroma.Web.MediaProxy.Invalidation.ScriptTest do import ExUnit.CaptureLog + setup do + on_exit(fn -> Cachex.clear(:banned_urls_cache) end) + end + test "it logger error when script not found" do assert capture_log(fn -> assert Invalidation.Script.purge( ["http://example.com/media/example.jpg"], - %{script_path: "./example"} - ) == {:error, "\"%ErlangError{original: :enoent}\""} - end) =~ "Error while cache purge: \"%ErlangError{original: :enoent}\"" + script_path: "./example" + ) == {:error, "%ErlangError{original: :enoent}"} + end) =~ "Error while cache purge: %ErlangError{original: :enoent}" - assert Invalidation.Script.purge( - ["http://example.com/media/example.jpg"], - %{} - ) == {:error, "not found script path"} + capture_log(fn -> + assert Invalidation.Script.purge( + ["http://example.com/media/example.jpg"], + [] + ) == {:error, "\"not found script path\""} + end) end end |