From 46c799f5284afe26756a6dd1b247af32de3be929 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 31 May 2023 09:50:47 -0400 Subject: [PATCH] Use Phoenix.ConnTest.redirected_to/2 --- changelog.d/3899.skip | 0 .../web/media_proxy/media_proxy_controller_test.exs | 9 ++------- test/pleroma/web/plugs/uploaded_media_plug_test.exs | 7 +------ 3 files changed, 3 insertions(+), 13 deletions(-) create mode 100644 changelog.d/3899.skip diff --git a/changelog.d/3899.skip b/changelog.d/3899.skip new file mode 100644 index 000000000..e69de29bb diff --git a/test/pleroma/web/media_proxy/media_proxy_controller_test.exs b/test/pleroma/web/media_proxy/media_proxy_controller_test.exs index 019e389b7..deb407709 100644 --- a/test/pleroma/web/media_proxy/media_proxy_controller_test.exs +++ b/test/pleroma/web/media_proxy/media_proxy_controller_test.exs @@ -77,14 +77,9 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyControllerTest do with_mock Pleroma.ReverseProxy, call: fn _conn, _url, _opts -> %Conn{status: :success} end do - %{resp_headers: resp_headers, status: status} = get(conn, proxy_url) + conn = get(conn, proxy_url) - assert status == 302 - - assert Enum.any?( - resp_headers, - &(&1 == {"location", expected_url}) - ) + assert redirected_to(conn, 302) == expected_url end end diff --git a/test/pleroma/web/plugs/uploaded_media_plug_test.exs b/test/pleroma/web/plugs/uploaded_media_plug_test.exs index fcc523cf4..dbf8ca5ec 100644 --- a/test/pleroma/web/plugs/uploaded_media_plug_test.exs +++ b/test/pleroma/web/plugs/uploaded_media_plug_test.exs @@ -64,11 +64,6 @@ defmodule Pleroma.Web.Plugs.UploadedMediaPlugTest do |> Map.put(:scheme, new_media_scheme) |> URI.to_string() - assert conn.status == 302 - - assert Enum.any?( - conn.resp_headers, - &(&1 == {"location", expected_url}) - ) + assert redirected_to(conn, 302) == expected_url end end