mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 00:26:30 +00:00
update tests
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
5ff3783d01
commit
c03852fbc7
1 changed files with 16 additions and 4 deletions
|
@ -2678,13 +2678,25 @@ defmodule Pleroma.UserTest do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "full_nickname/1" do
|
describe "full_nickname/1" do
|
||||||
test "returns fully qualified nickname for local and remote users" do
|
test "returns fully qualified nickname for local users" do
|
||||||
local_user =
|
local_user = insert(:user, nickname: "local_user")
|
||||||
insert(:user, nickname: "local_user", ap_id: "https://somehost.com/users/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)
|
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"
|
assert User.full_nickname(remote_user) == "remote@host.com"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue