summaryrefslogtreecommitdiff
path: root/test/web/auth
diff options
context:
space:
mode:
authorRoman Chvanikov <chvanikoff@pm.me>2020-05-18 11:56:27 +0300
committerRoman Chvanikov <chvanikoff@pm.me>2020-05-18 11:56:27 +0300
commit01bd6a1e54c8734e8965f153a9406cecc07950f3 (patch)
tree791348626f54b390167693da8c1a6481c54d78de /test/web/auth
parent8a383707ae143ba47fa1ba68da20bc6bec425126 (diff)
parent1199cf3a788334cd3fdb968d9f736e43c1401da1 (diff)
downloadpleroma-01bd6a1e54c8734e8965f153a9406cecc07950f3.tar.gz
pleroma-01bd6a1e54c8734e8965f153a9406cecc07950f3.zip
Merge branch 'develop' into feature/admin-api-status-count-per-instance
Diffstat (limited to 'test/web/auth')
-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