1 defmodule Pleroma.Web.MediaProxy.Invalidation.ScriptTest do
3 alias Pleroma.Web.MediaProxy.Invalidation
5 import ExUnit.CaptureLog
7 test "it logger error when script not found" do
8 assert capture_log(fn ->
9 assert Invalidation.Script.purge(
10 ["http://example.com/media/example.jpg"],
11 %{script_path: "./example"}
12 ) == {:error, "\"%ErlangError{original: :enoent}\""}
13 end) =~ "Error while cache purge: \"%ErlangError{original: :enoent}\""
15 assert Invalidation.Script.purge(
16 ["http://example.com/media/example.jpg"],
18 ) == {:error, "not found script path"}