summaryrefslogtreecommitdiff
path: root/test/plugs/legacy_authentication_plug_test.exs
diff options
context:
space:
mode:
authorIvan Tashkinov <ivant.business@gmail.com>2019-04-08 12:20:26 +0300
committerIvan Tashkinov <ivant.business@gmail.com>2019-04-08 12:20:26 +0300
commitbffddf5e31c53d0603de387c61b6011f70785b97 (patch)
tree97f07fb95346b603307534a34d0ecee5c9b70af1 /test/plugs/legacy_authentication_plug_test.exs
parente3328bc1382315c9067c099995a29db70d9d0433 (diff)
parentb177e1e7f330ff1531be190949db7f75e378a449 (diff)
downloadpleroma-bffddf5e31c53d0603de387c61b6011f70785b97.tar.gz
pleroma-bffddf5e31c53d0603de387c61b6011f70785b97.zip
[#923] Merge remote-tracking branch 'remotes/upstream/develop' into twitter_oauth
# Conflicts: # docs/config.md # test/support/factory.ex
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