diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2019-04-08 16:29:20 +0700 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2019-04-08 16:29:20 +0700 |
commit | a1a854646e96598473ed7a323e034cf1f88ca508 (patch) | |
tree | 4a427437c7c444fdfd2bb99dc012a7008d9bb0fe /test/plugs/legacy_authentication_plug_test.exs | |
parent | 1c2e4f88d1a707791818014f8bcdedd986c2fa75 (diff) | |
parent | fb2040d06199f2f4190ff363da54d6fcfa87ff69 (diff) | |
download | pleroma-a1a854646e96598473ed7a323e034cf1f88ca508.tar.gz pleroma-a1a854646e96598473ed7a323e034cf1f88ca508.zip |
Merge branch 'develop' into use-jobs-in-webpush
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 |