summaryrefslogtreecommitdiff
path: root/test/web/admin_api/controllers/media_proxy_cache_controller_test.exs
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2020-06-17 13:13:55 -0500
committerMark Felder <feld@FreeBSD.org>2020-06-17 13:13:55 -0500
commit2731ea1334c2c91315465659a0874829cb9e1e11 (patch)
tree4c6ce333a75350b40d4a406f069cd5363da57172 /test/web/admin_api/controllers/media_proxy_cache_controller_test.exs
parentc08c9db0c137d36896910194a6dc50a391a8fee2 (diff)
downloadpleroma-2731ea1334c2c91315465659a0874829cb9e1e11.tar.gz
pleroma-2731ea1334c2c91315465659a0874829cb9e1e11.zip
Change references from "deleted_urls" to "banned_urls" as nothing is handled via media deletions anymore; all actions are manual operations by an admin to ban the url
Diffstat (limited to 'test/web/admin_api/controllers/media_proxy_cache_controller_test.exs')
-rw-r--r--test/web/admin_api/controllers/media_proxy_cache_controller_test.exs24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/web/admin_api/controllers/media_proxy_cache_controller_test.exs b/test/web/admin_api/controllers/media_proxy_cache_controller_test.exs
index 42a3c0dd8..5ab6cb78a 100644
--- a/test/web/admin_api/controllers/media_proxy_cache_controller_test.exs
+++ b/test/web/admin_api/controllers/media_proxy_cache_controller_test.exs
@@ -13,7 +13,7 @@ defmodule Pleroma.Web.AdminAPI.MediaProxyCacheControllerTest do
setup do: clear_config([:media_proxy])
setup do
- on_exit(fn -> Cachex.clear(:deleted_urls_cache) end)
+ on_exit(fn -> Cachex.clear(:banned_urls_cache) end)
end
setup do
@@ -34,14 +34,14 @@ defmodule Pleroma.Web.AdminAPI.MediaProxyCacheControllerTest do
describe "GET /api/pleroma/admin/media_proxy_caches" do
test "shows banned MediaProxy URLs", %{conn: conn} do
- MediaProxy.put_in_deleted_urls([
+ MediaProxy.put_in_banned_urls([
"http://localhost:4001/media/a688346.jpg",
"http://localhost:4001/media/fb1f4d.jpg"
])
- MediaProxy.put_in_deleted_urls("http://localhost:4001/media/gb1f44.jpg")
- MediaProxy.put_in_deleted_urls("http://localhost:4001/media/tb13f47.jpg")
- MediaProxy.put_in_deleted_urls("http://localhost:4001/media/wb1f46.jpg")
+ MediaProxy.put_in_banned_urls("http://localhost:4001/media/gb1f44.jpg")
+ MediaProxy.put_in_banned_urls("http://localhost:4001/media/tb13f47.jpg")
+ MediaProxy.put_in_banned_urls("http://localhost:4001/media/wb1f46.jpg")
response =
conn
@@ -74,7 +74,7 @@ defmodule Pleroma.Web.AdminAPI.MediaProxyCacheControllerTest do
describe "POST /api/pleroma/admin/media_proxy_caches/delete" do
test "deleted MediaProxy URLs from banned", %{conn: conn} do
- MediaProxy.put_in_deleted_urls([
+ MediaProxy.put_in_banned_urls([
"http://localhost:4001/media/a688346.jpg",
"http://localhost:4001/media/fb1f4d.jpg"
])
@@ -88,8 +88,8 @@ defmodule Pleroma.Web.AdminAPI.MediaProxyCacheControllerTest do
|> json_response_and_validate_schema(200)
assert response["urls"] == ["http://localhost:4001/media/a688346.jpg"]
- refute MediaProxy.in_deleted_urls("http://localhost:4001/media/a688346.jpg")
- assert MediaProxy.in_deleted_urls("http://localhost:4001/media/fb1f4d.jpg")
+ refute MediaProxy.in_banned_urls("http://localhost:4001/media/a688346.jpg")
+ assert MediaProxy.in_banned_urls("http://localhost:4001/media/fb1f4d.jpg")
end
end
@@ -114,8 +114,8 @@ defmodule Pleroma.Web.AdminAPI.MediaProxyCacheControllerTest do
assert response["urls"] == urls
- refute MediaProxy.in_deleted_urls("http://example.com/media/a688346.jpg")
- refute MediaProxy.in_deleted_urls("http://example.com/media/fb1f4d.jpg")
+ refute MediaProxy.in_banned_urls("http://example.com/media/a688346.jpg")
+ refute MediaProxy.in_banned_urls("http://example.com/media/fb1f4d.jpg")
end
end
@@ -137,8 +137,8 @@ defmodule Pleroma.Web.AdminAPI.MediaProxyCacheControllerTest do
assert response["urls"] == urls
- assert MediaProxy.in_deleted_urls("http://example.com/media/a688346.jpg")
- assert MediaProxy.in_deleted_urls("http://example.com/media/fb1f4d.jpg")
+ assert MediaProxy.in_banned_urls("http://example.com/media/a688346.jpg")
+ assert MediaProxy.in_banned_urls("http://example.com/media/fb1f4d.jpg")
end
end
end