logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: c03852fbc78f8b02aef2189409f393a339ac113f
parent 5ff3783d018476bad954881e39f714fac0630436
Author: marcin mikołajczak <git@mkljczk.pl>
Date:   Wed, 23 Nov 2022 00:13:06 +0100

update tests

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>

Diffstat:

Mtest/pleroma/user_test.exs20++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs @@ -2678,13 +2678,25 @@ defmodule Pleroma.UserTest do end describe "full_nickname/1" do - test "returns fully qualified nickname for local and remote users" do - local_user = - insert(:user, nickname: "local_user", ap_id: "https://somehost.com/users/local_user") + test "returns fully qualified nickname for local users" do + local_user = insert(:user, nickname: "local_user") + assert User.full_nickname(local_user) == "local_user@localhost" + end + + test "returns fully qualified nickname for local users when using different domain for webfinger" do + clear_config([Pleroma.Web.WebFinger, :domain], "plemora.dev") + + host = Pleroma.Web.Endpoint.host() + + local_user = insert(:user, nickname: "local_user") + + assert User.full_nickname(local_user) == "local_user@plemora.dev" + end + + test "returns fully qualified nickname for remote users" do remote_user = insert(:user, nickname: "remote@host.com", local: false) - assert User.full_nickname(local_user) == "local_user@somehost.com" assert User.full_nickname(remote_user) == "remote@host.com" end