diff options
| author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-05-20 20:27:03 +0300 |
|---|---|---|
| committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-05-20 20:27:03 +0300 |
| commit | 6fd4f58ead9189697ed004b6ca593d5ba746898f (patch) | |
| tree | 447bf02a1bc76941686e2017b6b8bed4494737d4 /test/web/mastodon_api/controllers/timeline_controller_test.exs | |
| parent | 1871a5ddb4a803ebe4fae6943a9b9c94f1f9c1a8 (diff) | |
| parent | 265746b21f5a58f49efbdbe9d9eecd697781b93b (diff) | |
| download | pleroma-6fd4f58ead9189697ed004b6ca593d5ba746898f.tar.gz pleroma-6fd4f58ead9189697ed004b6ca593d5ba746898f.zip | |
Merge remote-tracking branch 'remotes/origin/develop' into 2168-media-preview-proxy
Diffstat (limited to 'test/web/mastodon_api/controllers/timeline_controller_test.exs')
| -rw-r--r-- | test/web/mastodon_api/controllers/timeline_controller_test.exs | 70 |
1 files changed, 1 insertions, 69 deletions
diff --git a/test/web/mastodon_api/controllers/timeline_controller_test.exs b/test/web/mastodon_api/controllers/timeline_controller_test.exs index f8b9289f3..2375ac8e8 100644 --- a/test/web/mastodon_api/controllers/timeline_controller_test.exs +++ b/test/web/mastodon_api/controllers/timeline_controller_test.exs @@ -20,12 +20,10 @@ defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do describe "home" do setup do: oauth_access(["read:statuses"]) - test "does NOT render account/pleroma/relationship if this is disabled by default", %{ + test "does NOT embed account/pleroma/relationship in statuses", %{ user: user, conn: conn } do - clear_config([:extensions, :output_relationships_in_statuses_by_default], false) - other_user = insert(:user) {:ok, _} = CommonAPI.post(other_user, %{status: "hi @#{user.nickname}"}) @@ -41,72 +39,6 @@ defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do end) end - test "the home timeline", %{user: user, conn: conn} do - uri = "/api/v1/timelines/home?with_relationships=1" - - 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_and_validate_schema(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_and_validate_schema(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_and_validate_schema(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"}) |
