Display html links correctly for remote activies.
This commit is contained in:
parent
c3dfa1970f
commit
558ab6e74e
2 changed files with 38 additions and 3 deletions
|
|
@ -4,9 +4,23 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenterTest do
|
|||
alias Pleroma.Web.OStatus.ActivityRepresenter
|
||||
alias Pleroma.{User, Activity, Object}
|
||||
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||
alias Pleroma.Web.OStatus
|
||||
|
||||
import Pleroma.Factory
|
||||
|
||||
test "an external note activity" do
|
||||
incoming = File.read!("test/fixtures/mastodon-note-cw.xml")
|
||||
{:ok, [activity]} = OStatus.handle_incoming(incoming)
|
||||
|
||||
user = User.get_cached_by_ap_id(activity.data["actor"])
|
||||
|
||||
tuple = ActivityRepresenter.to_simple_form(activity, user)
|
||||
|
||||
res = :xmerl.export_simple_content(tuple, :xmerl_xml) |> IO.iodata_to_binary
|
||||
|
||||
assert String.contains?(res, ~s{<link type="text/html" href="https://mastodon.social/users/lambadalambda/updates/2314748" rel="alternate"/>})
|
||||
end
|
||||
|
||||
test "a note activity" do
|
||||
note_activity = insert(:note_activity)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue