diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-05-09 18:05:44 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-05-09 18:05:44 +0300 |
commit | 14a49a04837b0dc5a0d72dd7c5b4dfa482801e7c (patch) | |
tree | 3eb096cd798420352ecdc2f3f5ea91b01c6f6bdb /test/web | |
parent | b2924ab1fbba4e6add15030cf8444d2d3f0cfe0c (diff) | |
download | pleroma-14a49a04837b0dc5a0d72dd7c5b4dfa482801e7c.tar.gz |
[#2456] Dropped support for embedded `pleroma/account/relationship` in statuses and notifications.
Diffstat (limited to 'test/web')
-rw-r--r-- | test/web/mastodon_api/controllers/timeline_controller_test.exs | 80 |
1 files changed, 1 insertions, 79 deletions
diff --git a/test/web/mastodon_api/controllers/timeline_controller_test.exs b/test/web/mastodon_api/controllers/timeline_controller_test.exs index b8bb83af7..47541979d 100644 --- a/test/web/mastodon_api/controllers/timeline_controller_test.exs +++ b/test/web/mastodon_api/controllers/timeline_controller_test.exs @@ -20,7 +20,7 @@ defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do describe "home" do setup do: oauth_access(["read:statuses"]) - test "does NOT render account/pleroma/relationship by default", %{ + test "does NOT embed account/pleroma/relationship in statuses", %{ user: user, conn: conn } do @@ -39,84 +39,6 @@ defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do end) end - test "embeds account relationships with `with_relationships=true`", %{user: user, conn: conn} do - uri = "/api/v1/timelines/home?with_relationships=true" - - following = insert(:user, nickname: "followed") - third_user = insert(:user, nickname: "repeated") - - {:ok, _activity} = CommonAPI.post(following, %{"status" => "post"}) - {:ok, activity} = CommonAPI.post(third_user, %{"status" => "repeated post"}) - {:ok, _, _} = CommonAPI.repeat(activity.id, following) - - ret_conn = get(conn, uri) - - assert Enum.empty?(json_response(ret_conn, :ok)) - - {:ok, _user} = User.follow(user, following) - - ret_conn = get(conn, uri) - - assert [ - %{ - "reblog" => %{ - "content" => "repeated post", - "account" => %{ - "pleroma" => %{ - "relationship" => %{"following" => false, "followed_by" => false} - } - } - }, - "account" => %{ - "pleroma" => %{ - "relationship" => %{"following" => true} - } - } - }, - %{ - "content" => "post", - "account" => %{ - "acct" => "followed", - "pleroma" => %{ - "relationship" => %{"following" => true} - } - } - } - ] = json_response(ret_conn, :ok) - - {:ok, _user} = User.follow(third_user, user) - - ret_conn = get(conn, uri) - - assert [ - %{ - "reblog" => %{ - "content" => "repeated post", - "account" => %{ - "acct" => "repeated", - "pleroma" => %{ - "relationship" => %{"following" => false, "followed_by" => true} - } - } - }, - "account" => %{ - "pleroma" => %{ - "relationship" => %{"following" => true} - } - } - }, - %{ - "content" => "post", - "account" => %{ - "acct" => "followed", - "pleroma" => %{ - "relationship" => %{"following" => true} - } - } - } - ] = json_response(ret_conn, :ok) - end - test "the home timeline when the direct messages are excluded", %{user: user, conn: conn} do {:ok, public_activity} = CommonAPI.post(user, %{"status" => ".", "visibility" => "public"}) {:ok, direct_activity} = CommonAPI.post(user, %{"status" => ".", "visibility" => "direct"}) |