aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-10-01 21:40:35 +0200
committerThibaut Girka <thib@sitedethib.com>2019-10-01 22:39:25 +0200
commit427d0c2a007db6c8424c64a8f3504420e5203bef (patch)
tree469ac233bc8d5a7881d436cc8bcbafa7cf6e7d11 /test
parent43e3db0951c34859932f20d8c82284343a82fcf1 (diff)
downloadpleroma-427d0c2a007db6c8424c64a8f3504420e5203bef.tar.gz
Store private announcements in object.data["announcements"], filter them on display
Diffstat (limited to 'test')
-rw-r--r--test/web/mastodon_api/controllers/status_controller_test.exs19
1 files changed, 18 insertions, 1 deletions
diff --git a/test/web/mastodon_api/controllers/status_controller_test.exs b/test/web/mastodon_api/controllers/status_controller_test.exs
index 727a233e7..b648ad6ff 100644
--- a/test/web/mastodon_api/controllers/status_controller_test.exs
+++ b/test/web/mastodon_api/controllers/status_controller_test.exs
@@ -557,7 +557,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|> post("/api/v1/statuses/#{activity.id}/reblog", %{"visibility" => "private"})
assert %{
- "reblog" => %{"id" => id, "reblogged" => true, "reblogs_count" => 0},
+ "reblog" => %{"id" => id, "reblogged" => true, "reblogs_count" => 1},
"reblogged" => true,
"visibility" => "private"
} = json_response(conn, 200)
@@ -1167,6 +1167,23 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
assert Enum.empty?(response)
end
+ test "does not return users who have reblogged the status privately", %{
+ conn: %{assigns: %{user: user}} = conn,
+ activity: activity
+ } do
+ other_user = insert(:user)
+
+ {:ok, _, _} = CommonAPI.repeat(activity.id, other_user, %{"visibility" => "private"})
+
+ response =
+ conn
+ |> assign(:user, user)
+ |> get("/api/v1/statuses/#{activity.id}/reblogged_by")
+ |> json_response(:ok)
+
+ assert Enum.empty?(response)
+ end
+
test "does not fail on an unauthenticated request", %{conn: conn, activity: activity} do
other_user = insert(:user)
{:ok, _, _} = CommonAPI.repeat(activity.id, other_user)