mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-24 09:00:29 +00:00
18 lines
534 B
Elixir
18 lines
534 B
Elixir
defmodule Pleroma.Web.ActivityPub.UserViewTest do
|
|
use Pleroma.DataCase
|
|
import Pleroma.Factory
|
|
|
|
alias Pleroma.Web.ActivityPub.UserView
|
|
|
|
test "Renders a user, including the public key" do
|
|
user = insert(:user)
|
|
{:ok, user} = Pleroma.Web.WebFinger.ensure_keys_present(user)
|
|
|
|
result = UserView.render("user.json", %{user: user})
|
|
|
|
assert result["id"] == user.ap_id
|
|
assert result["preferredUsername"] == user.nickname
|
|
|
|
assert String.contains?(result["publicKey"]["publicKeyPem"], "BEGIN PUBLIC KEY")
|
|
end
|
|
end
|