summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTusooa Zhu <tusooa@kazv.moe>2022-05-05 18:39:34 -0400
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2022-05-06 10:23:26 +0200
commite2d24eda5745310346b5e347efddbc68723612f0 (patch)
tree59a5e12139e63836ac9cbb1b91d91a3b38504fa2 /test
parentc3b2b71ea211d7e377186cace419703f5e3f2d68 (diff)
downloadpleroma-e2d24eda5745310346b5e347efddbc68723612f0.tar.gz
pleroma-e2d24eda5745310346b5e347efddbc68723612f0.zip
Allow to skip cache in Cache plug
Ref: fix-local-public
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/plugs/cache_test.exs18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/pleroma/web/plugs/cache_test.exs b/test/pleroma/web/plugs/cache_test.exs
index d84e2d268..0c119528d 100644
--- a/test/pleroma/web/plugs/cache_test.exs
+++ b/test/pleroma/web/plugs/cache_test.exs
@@ -179,4 +179,22 @@ defmodule Pleroma.Web.Plugs.CacheTest do
|> send_resp(:im_a_teapot, "🥤")
|> sent_resp()
end
+
+ test "ignores if skip_cache is assigned" do
+ assert @miss_resp ==
+ conn(:get, "/")
+ |> assign(:skip_cache, true)
+ |> Cache.call(%{query_params: false, ttl: nil})
+ |> put_resp_content_type("cofe/hot")
+ |> send_resp(:ok, "cofe")
+ |> sent_resp()
+
+ assert @miss_resp ==
+ conn(:get, "/")
+ |> assign(:skip_cache, true)
+ |> Cache.call(%{query_params: false, ttl: nil})
+ |> put_resp_content_type("cofe/hot")
+ |> send_resp(:ok, "cofe")
+ |> sent_resp()
+ end
end