aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-05-17 11:53:17 +0200
committerlain <lain@soykaf.club>2020-05-17 11:53:17 +0200
commit8bfd9710ae70204b29e184f08d78b95a2f81ad6c (patch)
tree2a045e23969e2ce2df5e2cbd7d5b31b9a4b6d80c /test
parentbfdd90f6d7c9bb85e572033070d6fa7efda8aeac (diff)
downloadpleroma-8bfd9710ae70204b29e184f08d78b95a2f81ad6c.tar.gz
Pleroma Authenticator: Also update passwords here.
Diffstat (limited to 'test')
-rw-r--r--test/web/auth/pleroma_authenticator_test.exs9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/web/auth/pleroma_authenticator_test.exs b/test/web/auth/pleroma_authenticator_test.exs
index 5a421e5ed..731bd5932 100644
--- a/test/web/auth/pleroma_authenticator_test.exs
+++ b/test/web/auth/pleroma_authenticator_test.exs
@@ -15,11 +15,16 @@ defmodule Pleroma.Web.Auth.PleromaAuthenticatorTest do
{:ok, [user: user, name: name, password: password]}
end
- test "get_user/authorization", %{user: user, name: name, password: password} do
+ test "get_user/authorization", %{name: name, password: password} do
+ name = name <> "1"
+ user = insert(:user, nickname: name, password_hash: Bcrypt.hash_pwd_salt(password))
+
params = %{"authorization" => %{"name" => name, "password" => password}}
res = PleromaAuthenticator.get_user(%Plug.Conn{params: params})
- assert {:ok, user} == res
+ assert {:ok, returned_user} = res
+ assert returned_user.id == user.id
+ assert "$pbkdf2" <> _ = returned_user.password_hash
end
test "get_user/authorization with invalid password", %{name: name} do