summaryrefslogtreecommitdiff
path: root/test/pleroma/web/plugs/cache_test.exs
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2022-05-06 08:19:03 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2022-05-06 08:19:03 +0000
commitb22843a98247cf683764759f3e447845f3fcedf8 (patch)
tree970a1d0515c784b7fc00a2934b8494badb569d85 /test/pleroma/web/plugs/cache_test.exs
parent62a45747d90c2ad400373650b9c03693acfa7708 (diff)
parent57c486014c06715ff5cd5ad4361155d4a1776c23 (diff)
Merge branch 'security/2.4.3' into 'stable'v2.4.3
Release: 2.4.3 See merge request pleroma/pleroma!3662
Diffstat (limited to 'test/pleroma/web/plugs/cache_test.exs')
-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 0ceab6cab..4e729cafb 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