diff options
author | lain <lain@soykaf.club> | 2020-09-17 11:56:30 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-09-17 11:56:30 +0000 |
commit | 5426eb59976044f88247486da86a91b8f9eb35b5 (patch) | |
tree | c3356281c7f21a8f6e41230e01b2d413a7f5903c /test/web/common_api | |
parent | c5acbf8a1bd1a14ea82610cb3f69b8ebbb3ea28b (diff) | |
parent | 5e3c70afa5c02926a5578628431487e92b2175e9 (diff) | |
download | pleroma-5426eb59976044f88247486da86a91b8f9eb35b5.tar.gz pleroma-5426eb59976044f88247486da86a91b8f9eb35b5.zip |
Merge branch 'chat-moderation' into 'develop'
Chat moderation MVP
See merge request pleroma/pleroma!2937
Diffstat (limited to 'test/web/common_api')
-rw-r--r-- | test/web/common_api/common_api_test.exs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index 5afb0a6dc..f5559f932 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -1193,4 +1193,24 @@ defmodule Pleroma.Web.CommonAPITest do assert Visibility.get_visibility(activity) == "private" end end + + describe "get_user/1" do + test "gets user by ap_id" do + user = insert(:user) + assert CommonAPI.get_user(user.ap_id) == user + end + + test "gets user by guessed nickname" do + user = insert(:user, ap_id: "", nickname: "mario@mushroom.kingdom") + assert CommonAPI.get_user("https://mushroom.kingdom/users/mario") == user + end + + test "fallback" do + assert %User{ + name: "", + ap_id: "", + nickname: "erroruser@example.com" + } = CommonAPI.get_user("") + end + end end |