X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Ftwitter_api%2Fpassword_controller_test.exs;h=a5e9e2178d84d95bdde9cefb534c3d51533c7fd2;hb=5c4ff5c73ce41f252e99a3c5c445efcecaa43dfe;hp=dc6d4e3e32b43cf8a143717a5c27c424fd85af49;hpb=1a858134edabfe9a85e07fb801b9ed41649ba08a;p=akkoma
diff --git a/test/web/twitter_api/password_controller_test.exs b/test/web/twitter_api/password_controller_test.exs
index dc6d4e3e3..a5e9e2178 100644
--- a/test/web/twitter_api/password_controller_test.exs
+++ b/test/web/twitter_api/password_controller_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.TwitterAPI.PasswordControllerTest do
@@ -37,7 +37,7 @@ defmodule Pleroma.Web.TwitterAPI.PasswordControllerTest do
test "it returns HTTP 200", %{conn: conn} do
user = insert(:user)
{:ok, token} = PasswordResetToken.create_token(user)
- {:ok, _access_token} = Token.create_token(insert(:oauth_app), user, %{})
+ {:ok, _access_token} = Token.create(insert(:oauth_app), user, %{})
params = %{
"password" => "test",
@@ -54,15 +54,15 @@ defmodule Pleroma.Web.TwitterAPI.PasswordControllerTest do
assert response =~ "
Password changed!
"
user = refresh_record(user)
- assert Comeonin.Pbkdf2.checkpw("test", user.password_hash)
- assert length(Token.get_user_tokens(user)) == 0
+ assert Pbkdf2.verify_pass("test", user.password_hash)
+ assert Enum.empty?(Token.get_user_tokens(user))
end
test "it sets password_reset_pending to false", %{conn: conn} do
- user = insert(:user, info: %{password_reset_pending: true})
+ user = insert(:user, password_reset_pending: true)
{:ok, token} = PasswordResetToken.create_token(user)
- {:ok, _access_token} = Token.create_token(insert(:oauth_app), user, %{})
+ {:ok, _access_token} = Token.create(insert(:oauth_app), user, %{})
params = %{
"password" => "test",
@@ -75,7 +75,7 @@ defmodule Pleroma.Web.TwitterAPI.PasswordControllerTest do
|> post("/api/pleroma/password_reset", %{data: params})
|> html_response(:ok)
- assert User.get_by_id(user.id).info.password_reset_pending == false
+ assert User.get_by_id(user.id).password_reset_pending == false
end
end
end