diff options
author | lambda <lain@soykaf.club> | 2019-04-08 09:18:01 +0000 |
---|---|---|
committer | lambda <lain@soykaf.club> | 2019-04-08 09:18:01 +0000 |
commit | b4da2bc1d009ecca0d7821abe3577d1a920c41c0 (patch) | |
tree | c75ce1ec6e70724c29efe540a2439de635abc160 /test/plugs/legacy_authentication_plug_test.exs | |
parent | cfa6e7289f5cfdb1fce17eb89bc0513ff624480d (diff) | |
parent | b177e1e7f330ff1531be190949db7f75e378a449 (diff) | |
download | pleroma-b4da2bc1d009ecca0d7821abe3577d1a920c41c0.tar.gz |
Merge branch 'develop' into 'improve_upgrade_user_from_ap_id'
# Conflicts:
# config/config.exs
# docs/config.md
Diffstat (limited to 'test/plugs/legacy_authentication_plug_test.exs')
-rw-r--r-- | test/plugs/legacy_authentication_plug_test.exs | 18 |
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 |