diff options
author | Tusooa Zhu <tusooa@kazv.moe> | 2022-05-04 22:58:17 -0400 |
---|---|---|
committer | Tusooa Zhu <tusooa@kazv.moe> | 2022-05-06 13:54:12 -0400 |
commit | 38af42968d7731ca4923a5130244638749f43ee3 (patch) | |
tree | 4480d251ee382990056a14878ff57021a11b5716 | |
parent | c48be59f581fc6c3070a9d4cc889166b61981a6d (diff) | |
download | pleroma-38af42968d7731ca4923a5130244638749f43ee3.tar.gz pleroma-38af42968d7731ca4923a5130244638749f43ee3.zip |
Test that anonymous users cannot see local-only posts
Ref: fix-local-public
-rw-r--r-- | test/pleroma/web/mastodon_api/controllers/status_controller_test.exs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs index 6d8d5f05e..d3ba9fced 100644 --- a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs @@ -1923,7 +1923,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do test "other users can read local-only posts" do user = insert(:user) - %{user: reader, conn: conn} = oauth_access(["read:statuses"]) + %{user: _reader, conn: conn} = oauth_access(["read:statuses"]) {:ok, activity} = CommonAPI.post(user, %{status: "#2hu #2HU", visibility: "local"}) @@ -1935,18 +1935,15 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do assert received["id"] == activity.id end - test "other users can see local-only posts" do + test "anonymous users cannot see local-only posts" do user = insert(:user) - %{user: _reader, conn: conn} = oauth_access(["read:statuses"]) {:ok, activity} = CommonAPI.post(user, %{status: "#2hu #2HU", visibility: "local"}) - received = - conn + _received = + build_conn() |> get("/api/v1/statuses/#{activity.id}") - |> json_response_and_validate_schema(:ok) - - assert received["id"] == activity.id + |> json_response_and_validate_schema(:not_found) end end |