From 3c08d229db423052d0dd88b8a36fb39b0ae81ead Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 23 Dec 2018 20:11:29 +0000 Subject: tests: add legal boilerplate --- test/web/twitter_api/representers/activity_representer_test.exs | 4 ++++ test/web/twitter_api/representers/object_representer_test.exs | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'test/web/twitter_api/representers') diff --git a/test/web/twitter_api/representers/activity_representer_test.exs b/test/web/twitter_api/representers/activity_representer_test.exs index f6c60a744..2ac32aeb2 100644 --- a/test/web/twitter_api/representers/activity_representer_test.exs +++ b/test/web/twitter_api/representers/activity_representer_test.exs @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2018 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do use Pleroma.DataCase alias Pleroma.{User, Activity, Object} diff --git a/test/web/twitter_api/representers/object_representer_test.exs b/test/web/twitter_api/representers/object_representer_test.exs index 228b2ac42..c3cf330f1 100644 --- a/test/web/twitter_api/representers/object_representer_test.exs +++ b/test/web/twitter_api/representers/object_representer_test.exs @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2018 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.Web.TwitterAPI.Representers.ObjectReprenterTest do use Pleroma.DataCase -- cgit v1.2.3 From 52493467ac314ec58ed6123d3581428a82ec170c Mon Sep 17 00:00:00 2001 From: scarlett Date: Sun, 6 Jan 2019 10:16:40 +0000 Subject: Twitter API: Add a summary_html field. The intention here is to allow proper subject copying when it contains emoji, obviously this will require minor frontend changes, though. --- test/web/twitter_api/representers/activity_representer_test.exs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/web/twitter_api/representers') diff --git a/test/web/twitter_api/representers/activity_representer_test.exs b/test/web/twitter_api/representers/activity_representer_test.exs index 2ac32aeb2..ab3e04985 100644 --- a/test/web/twitter_api/representers/activity_representer_test.exs +++ b/test/web/twitter_api/representers/activity_representer_test.exs @@ -163,7 +163,8 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do "possibly_sensitive" => true, "uri" => activity.data["object"]["id"], "visibility" => "direct", - "summary" => "2hu" + "summary" => "2hu", + "summary_html" => "2hu" } assert ActivityRepresenter.to_map(activity, %{ -- cgit v1.2.3 From 44a1e6948488d9a96ed684f0a7855fe2fce02ed4 Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Wed, 9 Jan 2019 19:54:19 +0700 Subject: Add Twitter API for the pinned statuses ``` # Only return statuses that have been pinned GET /api/statuses/user_timeline.json?pinned=true # Pin POST /api/statuses/pin/:id # Unpin POST /api/statuses/unpin/:id ``` --- test/web/twitter_api/representers/activity_representer_test.exs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/web/twitter_api/representers') diff --git a/test/web/twitter_api/representers/activity_representer_test.exs b/test/web/twitter_api/representers/activity_representer_test.exs index 2ac32aeb2..a4f97e0f2 100644 --- a/test/web/twitter_api/representers/activity_representer_test.exs +++ b/test/web/twitter_api/representers/activity_representer_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2018 Pleroma Authors +# Copyright © 2017-2019 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do @@ -157,6 +157,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do "repeat_num" => 3, "favorited" => false, "repeated" => false, + "pinned" => false, "external_url" => "some url", "tags" => ["nsfw", "content", "mentioning"], "activity_type" => "post", -- cgit v1.2.3 From 8df348a3daaa9c5ac9693fd52b62594dfe9158be Mon Sep 17 00:00:00 2001 From: lain Date: Wed, 9 Jan 2019 17:18:37 +0100 Subject: Add test for summary_html --- .../twitter_api/representers/activity_representer_test.exs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'test/web/twitter_api/representers') diff --git a/test/web/twitter_api/representers/activity_representer_test.exs b/test/web/twitter_api/representers/activity_representer_test.exs index ab3e04985..d71aaacfe 100644 --- a/test/web/twitter_api/representers/activity_representer_test.exs +++ b/test/web/twitter_api/representers/activity_representer_test.exs @@ -107,7 +107,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do "published" => date, "type" => "Note", "content" => content_html, - "summary" => "2hu", + "summary" => "2hu :2hu:", "inReplyToStatusId" => 213_123, "attachment" => [ object @@ -129,7 +129,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do } expected_html = - "

2hu

alert('YAY')Some \"2hu\" content mentioning 2hu \"2hu\"

alert('YAY')Some \"2hu\" content mentioning
@shp" @@ -138,7 +138,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do "user" => UserView.render("show.json", %{user: user, for: follower}), "is_local" => false, "statusnet_html" => expected_html, - "text" => "2hu" <> content, + "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, @@ -163,8 +163,9 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenterTest do "possibly_sensitive" => true, "uri" => activity.data["object"]["id"], "visibility" => "direct", - "summary" => "2hu", - "summary_html" => "2hu" + "summary" => "2hu :2hu:", + "summary_html" => + "2hu \"2hu\"" } assert ActivityRepresenter.to_map(activity, %{ -- cgit v1.2.3