{:updated, h.(updated_at)}
] ++ attachments
end
+
+ def to_simple_form(_,_), do: nil
end
entries = Enum.map(activities, fn(activity) ->
{:entry, ActivityRepresenter.to_simple_form(activity, user)}
end)
+ |> Enum.filter(fn ({_, form}) -> form end)
[{
:feed, [
defmodule Pleroma.Web.Websub do
alias Pleroma.Repo
- alias Pleroma.Websub
alias Pleroma.Web.Websub.WebsubServerSubscription
alias Pleroma.Web.OStatus.FeedRepresenter
alias Pleroma.Web.OStatus
use Pleroma.DataCase
alias Pleroma.Web.OStatus.ActivityRepresenter
- alias Pleroma.User
+ alias Pleroma.{User, Activity}
import Pleroma.Factory
assert clean(res) == clean(expected)
end
+ test "an unknown activity" do
+ tuple = ActivityRepresenter.to_simple_form(%Activity{}, nil)
+ assert is_nil(tuple)
+ end
+
defp clean(string) do
String.replace(string, ~r/\s/, "")
end