2hu ) <> corndog_emojo <> ~s(
alert\('YAY'\)Some ) <> corndog_emojo <> ~s( content mentioning @shp) expected_status = %{ "id" => activity.id, "user" => UserView.render("show.json", %{user: user, for: follower}), "is_local" => false, "statusnet_html" => expected_html, "text" => "2hu :2hu:" <> content, "is_post_verb" => true, "created_at" => "Tue May 24 13:26:08 +0000 2016", "in_reply_to_status_id" => 213_123, "in_reply_to_screen_name" => nil, "in_reply_to_user_id" => nil, "in_reply_to_profileurl" => nil, "in_reply_to_ostatus_uri" => nil, "statusnet_conversation_id" => convo_object.id, "attachments" => [ ObjectRepresenter.to_map(object) ], "attentions" => [ UserView.render("show.json", %{user: mentioned_user, for: follower}) ], "fave_num" => 5, "repeat_num" => 3, "favorited" => false, "repeated" => false, "pinned" => false, "external_url" => "some url", "tags" => ["nsfw", "content", "mentioning"], "activity_type" => "post", "possibly_sensitive" => true, "uri" => activity.data["object"]["id"], "visibility" => "direct", "card" => nil, "muted" => false, "summary" => "2hu :2hu:", "summary_html" => "2hu " } assert ActivityRepresenter.to_map(activity, %{ user: user, for: follower, mentioned: [mentioned_user] }) == expected_status end test "a delete activity" do object = insert(:note) user = User.get_by_ap_id(object.data["actor"]) {:ok, delete} = ActivityPub.delete(object) map = ActivityRepresenter.to_map(delete, %{user: user}) assert map["is_post_verb"] == false assert map["activity_type"] == "delete" assert map["uri"] == object.data["id"] end end