X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Ftwitter_api%2Frepresenters%2Factivity_representer_test.exs;h=98a1705b09fd4bc4df9bd87be50a4023eacc3c2c;hb=460062f2b04220ffcd8f20aa842cc95582d1f849;hp=7e2ea630ca185f8bee57df0ad280b3266c8802a0;hpb=30e9b22f96f2bf1cd895e993190f40afba159bb6;p=akkoma diff --git a/test/web/twitter_api/representers/activity_representer_test.exs b/test/web/twitter_api/representers/activity_representer_test.exs index 7e2ea630c..98a1705b0 100644 --- a/test/web/twitter_api/representers/activity_representer_test.exs +++ b/test/web/twitter_api/representers/activity_representer_test.exs @@ -75,17 +75,17 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do date = DateTime.from_naive!(~N[2016-05-24 13:26:08.003], "Etc/UTC") |> DateTime.to_iso8601 {:ok, convo_object} = Object.context_mapping("2hu") |> Repo.insert - + to = [ + User.ap_followers(user), + "https://www.w3.org/ns/activitystreams#Public", + mentioned_user.ap_id + ] activity = %Activity{ id: 1, data: %{ "type" => "Create", "id" => "id", - "to" => [ - User.ap_followers(user), - "https://www.w3.org/ns/activitystreams#Public", - mentioned_user.ap_id - ], + "to" => to, "actor" => User.ap_id(user), "object" => %{ "published" => date, @@ -108,7 +108,8 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do "published" => date, "context" => "2hu" }, - local: false + local: false, + recipients: to } expected_html = "2hu
alert('YAY')Some 2hu content mentioning @shp" @@ -134,7 +135,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do "favorited" => false, "repeated" => false, "external_url" => "some url", - "tags" => ["content", "mentioning", "nsfw"], + "tags" => ["nsfw", "content", "mentioning"], "activity_type" => "post", "possibly_sensitive" => true, "uri" => activity.data["object"]["id"] @@ -147,7 +148,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do follower = insert(:user) followed = insert(:user) - {:ok, follow} = ActivityPub.follow(follower, followed) + {:ok, _follow} = ActivityPub.follow(follower, followed) {:ok, unfollow} = ActivityPub.unfollow(follower, followed) map = ActivityRepresenter.to_map(unfollow, %{user: follower})