ソースを参照

Mock :crypt.crypt/2 because otherwise the test fails on Mac OS

tags/v1.1.4
Sergey Suprunenko 5年前
コミット
e9c075d05c
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: 5DCA7D1BE3914F9C
1個のファイルの変更10行の追加8行の削除
  1. +10
    -8
      test/plugs/legacy_authentication_plug_test.exs

+ 10
- 8
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



読み込み中…
キャンセル
保存