Mock :crypt.crypt/2 because otherwise the test fails on Mac OS
This commit is contained in:
parent
e3ca9f708f
commit
e9c075d05c
1 changed files with 10 additions and 8 deletions
|
@ -47,16 +47,18 @@ defmodule Pleroma.Plugs.LegacyAuthenticationPlugTest do
|
||||||
|> assign(:auth_user, user)
|
|> assign(:auth_user, user)
|
||||||
|
|
||||||
conn =
|
conn =
|
||||||
with_mock User,
|
with_mocks([
|
||||||
reset_password: fn user, %{password: password, password_confirmation: password} ->
|
{:crypt, [], [crypt: fn _password, password_hash -> password_hash end]},
|
||||||
send(self(), :reset_password)
|
{User, [],
|
||||||
{:ok, user}
|
[
|
||||||
end do
|
reset_password: fn user, %{password: password, password_confirmation: password} ->
|
||||||
conn
|
{:ok, user}
|
||||||
|> LegacyAuthenticationPlug.call(%{})
|
end
|
||||||
|
]}
|
||||||
|
]) do
|
||||||
|
LegacyAuthenticationPlug.call(conn, %{})
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_received :reset_password
|
|
||||||
assert conn.assigns.user == user
|
assert conn.assigns.user == user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue