1 defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do
3 alias Pleroma.{User, Activity, Object}
4 alias Pleroma.Web.TwitterAPI.Representers.{UserRepresenter, ActivityRepresenter, ObjectRepresenter}
5 alias Pleroma.Builders.UserBuilder
8 {:ok, user} = UserBuilder.insert
9 {:ok, follower} = UserBuilder.insert(%{following: [User.ap_followers(user)]})
17 "mediaType" => "image/jpg",
18 "href" => "http://example.org/image.jpg"
25 content = "Some content"
26 date = DateTime.utc_now() |> DateTime.to_iso8601
33 User.ap_followers(user),
34 "https://www.w3.org/ns/activitystreams#Public"
39 "actor" => User.ap_id(user),
44 "inReplyToStatusId" => 213123,
45 "statusnetConversationId" => 4711
54 "user" => UserRepresenter.to_map(user, %{for: follower}),
57 "statusnet_html" => content,
59 "is_post_verb" => true,
61 "in_reply_to_status_id" => 213123,
62 "statusnet_conversation_id" => 4711,
64 ObjectRepresenter.to_map(object)
68 assert ActivityRepresenter.to_map(activity, %{user: user, for: follower}) == expected_status