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
36 "user" => UserRepresenter.to_map(user, %{for: follower}),
39 "statusnet_html" => content,
41 "is_post_verb" => true,
43 "in_reply_to_status_id" => 213123
46 assert ActivityRepresenter.to_map(activity, %{user: user, for: follower}) == expected_status