Fix spec.
[akkoma] / test / web / twitter_api / representers / activity_representer_test.exs
index b34d3b7875f46a3bfdf859670999cc40aa7171a0..b6510111529f029ea5d1533c7645341b57420e0b 100644 (file)
@@ -6,7 +6,11 @@ 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
+
     activity = %Activity{
       id: 1,
       data: %{
@@ -17,23 +21,28 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do
         ],
         "actor" => User.ap_id(user),
         "object" => %{
+          "published" => date,
           "type" => "Note",
-          "content" => content
-        }
+          "content" => content,
+          "inReplyToStatusId" => 213123
+        },
+        "published" => date
       }
     }
 
 
     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
+      "is_post_verb" => true,
+      "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