diff options
author | lain <lain@soykaf.club> | 2020-11-04 16:52:30 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-11-04 16:52:30 +0100 |
commit | 7bbc328d66aaac8d680f52521c6823aea42821af (patch) | |
tree | 5fa2ef3e91fd880e9170c718cca8245d73dc4ca3 /test/web/mongooseim/mongoose_im_controller_test.exs | |
parent | de2499e54b33a1746e5f6a5b79f1422d31c11570 (diff) | |
parent | 78cea44553c936813ffc2c4c47984a64255096ef (diff) | |
download | pleroma-7bbc328d66aaac8d680f52521c6823aea42821af.tar.gz pleroma-7bbc328d66aaac8d680f52521c6823aea42821af.zip |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into stats-genserver-fix
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 |