1 defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do
3 alias Pleroma.{User, Activity}
4 alias Pleroma.Web.TwitterAPI.Representers.{UserRepresenter, ActivityRepresenter}
5 alias Pleroma.Builders.UserBuilder
8 {:ok, user} = UserBuilder.insert
9 {:ok, follower} = UserBuilder.insert(%{following: [User.ap_followers(user)]})
11 content = "Some content"
12 date = DateTime.utc_now() |> DateTime.to_iso8601
19 User.ap_followers(user),
20 "https://www.w3.org/ns/activitystreams#Public"
22 "actor" => User.ap_id(user),
27 "inReplyToStatusId" => 213123,
28 "statusnetConversationId" => 4711
37 "user" => UserRepresenter.to_map(user, %{for: follower}),
40 "statusnet_html" => content,
42 "is_post_verb" => true,
44 "in_reply_to_status_id" => 213123,
45 "statusnet_conversation_id" => 4711
48 assert ActivityRepresenter.to_map(activity, %{user: user, for: follower}) == expected_status