logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma
commit: 876965a7e7bc369fcc48e8fc265db0e49569e056
parent: 9aeac7dccac802073977c8149b2dda1f0ce07226
Author: feld <feld@feld.me>
Date:   Sat,  6 Apr 2019 16:03:35 +0000

Merge branch 'fix/failed-legacy-test' into 'develop'

Mock :crypt.crypt/2 to pass LegacyAuthenticationPlugTest on Mac OS

See merge request pleroma/pleroma!1030

Diffstat:

Mtest/plugs/legacy_authentication_plug_test.exs18++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)

diff --git 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