diff options
author | Maxim Filippov <colixer@gmail.com> | 2019-09-24 13:00:48 +0300 |
---|---|---|
committer | Maxim Filippov <colixer@gmail.com> | 2019-09-24 13:00:48 +0300 |
commit | 5e9759cd7d0730c14bcc44e9b3dbda94947d602f (patch) | |
tree | 5917d89cad99d14a246e33f3e8ebd56e70abe20b /test/web/mastodon_api/mastodon_api_controller_test.exs | |
parent | 79c3443b609663ab23a4353ebdb7e5e2f0e6a150 (diff) | |
parent | 29dd8ab9c0ef28f9649fe0a5b29a0bbcfb4c0965 (diff) | |
download | pleroma-5e9759cd7d0730c14bcc44e9b3dbda94947d602f.tar.gz pleroma-5e9759cd7d0730c14bcc44e9b3dbda94947d602f.zip |
Merge branch 'develop' into feature/return-link-for-password-reset
Diffstat (limited to 'test/web/mastodon_api/mastodon_api_controller_test.exs')
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 35a0d3fe1..73a3bf135 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -97,6 +97,22 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do |> json_response(403) == %{"error" => "This resource requires authentication."} end + test "the public timeline includes only public statuses for an authenticated user" do + user = insert(:user) + + conn = + build_conn() + |> assign(:user, user) + + {:ok, _activity} = CommonAPI.post(user, %{"status" => "test"}) + {:ok, _activity} = CommonAPI.post(user, %{"status" => "test", "visibility" => "private"}) + {:ok, _activity} = CommonAPI.post(user, %{"status" => "test", "visibility" => "unlisted"}) + {:ok, _activity} = CommonAPI.post(user, %{"status" => "test", "visibility" => "direct"}) + + res_conn = get(conn, "/api/v1/timelines/public") + assert length(json_response(res_conn, 200)) == 1 + end + describe "posting statuses" do setup do user = insert(:user) @@ -998,9 +1014,9 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do |> get("/api/v1/notifications") expected_response = - "hi <span class=\"h-card\"><a data-user=\"#{user.id}\" class=\"u-url mention\" href=\"#{ + ~s(hi <span class="h-card"><a data-user="#{user.id}" class="u-url mention" href="#{ user.ap_id - }\">@<span>#{user.nickname}</span></a></span>" + }" rel="ugc">@<span>#{user.nickname}</span></a></span>) assert [%{"status" => %{"content" => response}} | _rest] = json_response(conn, 200) assert response == expected_response @@ -1020,9 +1036,9 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do |> get("/api/v1/notifications/#{notification.id}") expected_response = - "hi <span class=\"h-card\"><a data-user=\"#{user.id}\" class=\"u-url mention\" href=\"#{ + ~s(hi <span class="h-card"><a data-user="#{user.id}" class="u-url mention" href="#{ user.ap_id - }\">@<span>#{user.nickname}</span></a></span>" + }" rel="ugc">@<span>#{user.nickname}</span></a></span>) assert %{"status" => %{"content" => response}} = json_response(conn, 200) assert response == expected_response |