summaryrefslogtreecommitdiff
path: root/test/plugs/legacy_authentication_plug_test.exs
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2019-04-11 15:51:52 +0700
committerEgor Kislitsyn <egor@kislitsyn.com>2019-04-11 15:51:52 +0700
commit0f2f7d2cec8297b1b5645643d7584cde561ce628 (patch)
treeaa618de9dc399de2e3abf37ad9ecf66d8cb9761f /test/plugs/legacy_authentication_plug_test.exs
parent22ac2288be498bd6a5a6fefe2dc6d2e260a8dc39 (diff)
parente5d553aa45ffa218b0695d7976f012bfc1dcbafe (diff)
downloadpleroma-0f2f7d2cec8297b1b5645643d7584cde561ce628.tar.gz
pleroma-0f2f7d2cec8297b1b5645643d7584cde561ce628.zip
Merge remote-tracking branch 'pleroma/develop' into feature/disable-account
Diffstat (limited to 'test/plugs/legacy_authentication_plug_test.exs')
-rw-r--r--test/plugs/legacy_authentication_plug_test.exs18
1 files changed, 10 insertions, 8 deletions
diff --git a/test/plugs/legacy_authentication_plug_test.exs b/test/plugs/legacy_authentication_plug_test.exs
index 302662797..8b0b06772 100644
--- a/test/plugs/legacy_authentication_plug_test.exs
+++ b/test/plugs/legacy_authentication_plug_test.exs
@@ -47,16 +47,18 @@ defmodule Pleroma.Plugs.LegacyAuthenticationPlugTest do
|> assign(:auth_user, user)
conn =
- with_mock User,
- reset_password: fn user, %{password: password, password_confirmation: password} ->
- send(self(), :reset_password)
- {:ok, user}
- end do
- conn
- |> LegacyAuthenticationPlug.call(%{})
+ with_mocks([
+ {:crypt, [], [crypt: fn _password, password_hash -> password_hash end]},
+ {User, [],
+ [
+ reset_password: fn user, %{password: password, password_confirmation: password} ->
+ {:ok, user}
+ end
+ ]}
+ ]) do
+ LegacyAuthenticationPlug.call(conn, %{})
end
- assert_received :reset_password
assert conn.assigns.user == user
end