diff options
| author | Maksim Pechnikov <parallel588@gmail.com> | 2020-06-14 21:02:57 +0300 |
|---|---|---|
| committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-06-14 21:02:57 +0300 |
| commit | 2e8a236cef28c0b754aecb04a5c60c3b7655c5a6 (patch) | |
| tree | efba28e731bf9dcc57de2a20302179d9b210eefe /test/web/media_proxy/invalidations/http_test.exs | |
| parent | f9dcf15ecb684b4b802d731a216448c76913d462 (diff) | |
| download | pleroma-2e8a236cef28c0b754aecb04a5c60c3b7655c5a6.tar.gz pleroma-2e8a236cef28c0b754aecb04a5c60c3b7655c5a6.zip | |
fix invalidates media url's
Diffstat (limited to 'test/web/media_proxy/invalidations/http_test.exs')
| -rw-r--r-- | test/web/media_proxy/invalidations/http_test.exs | 13 |
1 files changed, 9 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..09e7ca0fb 100644 --- a/test/web/media_proxy/invalidations/http_test.exs +++ b/test/web/media_proxy/invalidations/http_test.exs @@ -5,6 +5,11 @@ defmodule Pleroma.Web.MediaProxy.Invalidation.HttpTest do import ExUnit.CaptureLog import Tesla.Mock + setup do + on_exit(fn -> Cachex.clear(:deleted_urls_cache) end) + :ok + 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 +19,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 +33,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 |
