X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Fostatus%2Ffeed_representer_test.exs;h=efd4e7217ed1cb7e394fedf6b0a7625a76581ca6;hb=2d21ea1a0e1be2e737dc4d283e72207580856214;hp=1b0a100303bb1181b945de0aad233168a22bd481;hpb=1feb193731881f87efda0dd3c08d554d2ef22971;p=akkoma
diff --git a/test/web/ostatus/feed_representer_test.exs b/test/web/ostatus/feed_representer_test.exs
index 1b0a10030..efd4e7217 100644
--- a/test/web/ostatus/feed_representer_test.exs
+++ b/test/web/ostatus/feed_representer_test.exs
@@ -1,8 +1,14 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2018 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.Web.OStatus.FeedRepresenterTest do
use Pleroma.DataCase
import Pleroma.Factory
alias Pleroma.User
- alias Pleroma.Web.OStatus.{FeedRepresenter, UserRepresenter, ActivityRepresenter}
+ alias Pleroma.Web.OStatus.ActivityRepresenter
+ alias Pleroma.Web.OStatus.FeedRepresenter
+ alias Pleroma.Web.OStatus.UserRepresenter
alias Pleroma.Web.OStatus
test "returns a feed of the last 20 items of the user" do
@@ -11,31 +17,39 @@ defmodule Pleroma.Web.OStatus.FeedRepresenterTest do
tuple = FeedRepresenter.to_simple_form(user, [note_activity], [user])
- most_recent_update = note_activity.updated_at
- |> NaiveDateTime.to_iso8601
+ most_recent_update =
+ note_activity.updated_at
+ |> NaiveDateTime.to_iso8601()
+
+ res = :xmerl.export_simple_content(tuple, :xmerl_xml) |> to_string
- res = :xmerl.export_simple_content(tuple, :xmerl_xml) |> IO.iodata_to_binary
- user_xml = UserRepresenter.to_simple_form(user)
- |> :xmerl.export_simple_content(:xmerl_xml)
+ user_xml =
+ UserRepresenter.to_simple_form(user)
+ |> :xmerl.export_simple_content(:xmerl_xml)
- entry_xml = ActivityRepresenter.to_simple_form(note_activity, user)
- |> :xmerl.export_simple_content(:xmerl_xml)
+ entry_xml =
+ ActivityRepresenter.to_simple_form(note_activity, user)
+ |> :xmerl.export_simple_content(:xmerl_xml)
expected = """
-
+
#{OStatus.feed_path(user)}
#{user.nickname}'s timeline
#{most_recent_update}
+ #{User.avatar_url(user)}
-
+
+
#{user_xml}
+
#{entry_xml}
"""
+
assert clean(res) == clean(expected)
end