Use Phoenix.ConnTest.redirected_to/2
This commit is contained in:
parent
d998a114e2
commit
46c799f528
0
changelog.d/3899.skip
Normal file
0
changelog.d/3899.skip
Normal file
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user