Fix spec.
[akkoma] / test / web / twitter_api / representers / activity_representer_test.exs
index ecfd5a73ffb913a6724dfe1b65757910b1fb1d18..b6510111529f029ea5d1533c7645341b57420e0b 100644 (file)
@@ -6,6 +6,8 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do
 
   test "an activity" do
     {:ok, user} = UserBuilder.insert
+    {:ok, follower} = UserBuilder.insert(%{following: [User.ap_followers(user)]})
+
     content = "Some content"
     date = DateTime.utc_now() |> DateTime.to_iso8601
 
@@ -21,7 +23,8 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do
         "object" => %{
           "published" => date,
           "type" => "Note",
-          "content" => content
+          "content" => content,
+          "inReplyToStatusId" => 213123
         },
         "published" => date
       }
@@ -30,15 +33,16 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do
 
     expected_status = %{
       "id" => activity.id,
-      "user" => UserRepresenter.to_map(user),
+      "user" => UserRepresenter.to_map(user, %{for: follower}),
       "is_local" => true,
       "attentions" => [],
       "statusnet_html" => content,
       "text" => content,
       "is_post_verb" => true,
-      "created_at" => date
+      "created_at" => date,
+      "in_reply_to_status_id" => 213123
     }
 
-    assert ActivityRepresenter.to_map(activity, %{user: user}) == expected_status
+    assert ActivityRepresenter.to_map(activity, %{user: user, for: follower}) == expected_status
   end
 end