Update majic & call plug before OpenApiSpex
[akkoma] / test / web / media_proxy / invalidations / script_test.exs
1 defmodule Pleroma.Web.MediaProxy.Invalidation.ScriptTest do
2 use ExUnit.Case
3 alias Pleroma.Web.MediaProxy.Invalidation
4
5 import ExUnit.CaptureLog
6
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}\""
14
15 assert Invalidation.Script.purge(
16 ["http://example.com/media/example.jpg"],
17 %{}
18 ) == {:error, "not found script path"}
19 end
20 end