forked from AkkomaGang/akkoma
requested changes to mongoose test
This commit is contained in:
parent
cc1e2e8d0f
commit
935ca2c132
1 changed files with 10 additions and 2 deletions
|
@ -9,6 +9,7 @@ defmodule Pleroma.Web.MongooseIMController do
|
||||||
test "/user_exists", %{conn: conn} do
|
test "/user_exists", %{conn: conn} do
|
||||||
_user = insert(:user, nickname: "lain")
|
_user = insert(:user, nickname: "lain")
|
||||||
_remote_user = insert(:user, nickname: "alice", local: false)
|
_remote_user = insert(:user, nickname: "alice", local: false)
|
||||||
|
_deactivated_user = insert(:user, nickname: "konata", deactivated: true)
|
||||||
|
|
||||||
res =
|
res =
|
||||||
conn
|
conn
|
||||||
|
@ -30,11 +31,18 @@ test "/user_exists", %{conn: conn} do
|
||||||
|> json_response(404)
|
|> json_response(404)
|
||||||
|
|
||||||
assert res == false
|
assert res == false
|
||||||
|
|
||||||
|
res =
|
||||||
|
conn
|
||||||
|
|> get(mongoose_im_path(conn, :user_exists), user: "konata")
|
||||||
|
|> json_response(404)
|
||||||
|
|
||||||
|
assert res == false
|
||||||
end
|
end
|
||||||
|
|
||||||
test "/check_password", %{conn: conn} do
|
test "/check_password", %{conn: conn} do
|
||||||
user = insert(:user, password_hash: Comeonin.Pbkdf2.hashpwsalt("cool"))
|
user = insert(:user, password_hash: Comeonin.Pbkdf2.hashpwsalt("cool"))
|
||||||
_deactivated_user = insert(:user, nickname: "konata", local: false, deactivated: true)
|
_deactivated_user = insert(:user, nickname: "konata", deactivated: true)
|
||||||
|
|
||||||
res =
|
res =
|
||||||
conn
|
conn
|
||||||
|
@ -52,7 +60,7 @@ test "/check_password", %{conn: conn} do
|
||||||
|
|
||||||
res =
|
res =
|
||||||
conn
|
conn
|
||||||
|> get(mongoose_im_path(conn, :check_password), user: "konata", pass: "1337")
|
|> get(mongoose_im_path(conn, :check_password), user: "konata", pass: "cool")
|
||||||
|> json_response(404)
|
|> json_response(404)
|
||||||
|
|
||||||
assert res == false
|
assert res == false
|
||||||
|
|
Loading…
Reference in a new issue