diff options
author | Alex Gleason <alex@alexgleason.me> | 2020-10-13 19:20:00 -0500 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2020-10-13 19:20:00 -0500 |
commit | c3112fd13a6af239b9dff0813e93266ec58f571e (patch) | |
tree | 7f2252d7a08e4a59b66e392b2732a1cdd8745758 /test/web/mongooseim/mongoose_im_controller_test.exs | |
parent | 66e00ace7c0708f2f9361bc6e1008ccea08cb6ef (diff) | |
parent | 481906207e6d803e5c4d3e455c7b93119e392177 (diff) | |
download | pleroma-c3112fd13a6af239b9dff0813e93266ec58f571e.tar.gz pleroma-c3112fd13a6af239b9dff0813e93266ec58f571e.zip |
Merge remote-tracking branch 'upstream/develop' into registration-workflow
Diffstat (limited to 'test/web/mongooseim/mongoose_im_controller_test.exs')
-rw-r--r-- | test/web/mongooseim/mongoose_im_controller_test.exs | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/test/web/mongooseim/mongoose_im_controller_test.exs b/test/web/mongooseim/mongoose_im_controller_test.exs deleted file mode 100644 index 5176cde84..000000000 --- a/test/web/mongooseim/mongoose_im_controller_test.exs +++ /dev/null @@ -1,81 +0,0 @@ -# Pleroma: A lightweight social networking server -# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/> -# SPDX-License-Identifier: AGPL-3.0-only - -defmodule Pleroma.Web.MongooseIMController do - use Pleroma.Web.ConnCase - import Pleroma.Factory - - test "/user_exists", %{conn: conn} do - _user = insert(:user, nickname: "lain") - _remote_user = insert(:user, nickname: "alice", local: false) - _deactivated_user = insert(:user, nickname: "konata", deactivated: true) - - res = - conn - |> get(mongoose_im_path(conn, :user_exists), user: "lain") - |> json_response(200) - - assert res == true - - res = - conn - |> get(mongoose_im_path(conn, :user_exists), user: "alice") - |> json_response(404) - - assert res == false - - res = - conn - |> get(mongoose_im_path(conn, :user_exists), user: "bob") - |> json_response(404) - - assert res == false - - res = - conn - |> get(mongoose_im_path(conn, :user_exists), user: "konata") - |> json_response(404) - - assert res == false - end - - test "/check_password", %{conn: conn} do - user = insert(:user, password_hash: Pbkdf2.hash_pwd_salt("cool")) - - _deactivated_user = - insert(:user, - nickname: "konata", - deactivated: true, - password_hash: Pbkdf2.hash_pwd_salt("cool") - ) - - res = - conn - |> get(mongoose_im_path(conn, :check_password), user: user.nickname, pass: "cool") - |> json_response(200) - - assert res == true - - res = - conn - |> get(mongoose_im_path(conn, :check_password), user: user.nickname, pass: "uncool") - |> json_response(403) - - assert res == false - - res = - conn - |> get(mongoose_im_path(conn, :check_password), user: "konata", pass: "cool") - |> json_response(404) - - assert res == false - - res = - conn - |> get(mongoose_im_path(conn, :check_password), user: "nobody", pass: "cool") - |> json_response(404) - - assert res == false - end -end |