diff options
| author | Roman Chvanikov <chvanikoff@pm.me> | 2020-06-23 20:56:55 +0300 |
|---|---|---|
| committer | Roman Chvanikov <chvanikoff@pm.me> | 2020-06-23 20:56:55 +0300 |
| commit | 1471b70ef1550df91687276968108231f1bab604 (patch) | |
| tree | 3a59e7497d665d5ce3d6445132453518bc50601d /test/web/media_proxy/invalidations/script_test.exs | |
| parent | 604a83ae3efe21b231fb524203a883a062102546 (diff) | |
| parent | c7d69e925664ce7125c3938c298d72e94a2a1349 (diff) | |
| download | pleroma-1471b70ef1550df91687276968108231f1bab604.tar.gz pleroma-1471b70ef1550df91687276968108231f1bab604.zip | |
Merge develop
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 |
