diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2020-05-26 17:12:26 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-05-26 17:12:26 +0300 |
commit | 1a7ed04f9c67c2fe90d10976f40cf972ca726653 (patch) | |
tree | 86e3028fd5788ac75c0110df867983097d9ce18a /test/web/feed/user_controller_test.exs | |
parent | 04a26ab0a80a5c2ae87d329a4a83c89532849862 (diff) | |
parent | b233c8e55cba773e8ee9a4affbcce3a3c05d1e2d (diff) | |
download | pleroma-1a7ed04f9c67c2fe90d10976f40cf972ca726653.tar.gz |
Merge branch 'develop' into fix/mediaproxy-http-invalidation
Diffstat (limited to 'test/web/feed/user_controller_test.exs')
-rw-r--r-- | test/web/feed/user_controller_test.exs | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/test/web/feed/user_controller_test.exs b/test/web/feed/user_controller_test.exs index 05ad427c2..fa2ed1ea5 100644 --- a/test/web/feed/user_controller_test.exs +++ b/test/web/feed/user_controller_test.exs @@ -11,13 +11,14 @@ defmodule Pleroma.Web.Feed.UserControllerTest do alias Pleroma.Config alias Pleroma.Object alias Pleroma.User + alias Pleroma.Web.CommonAPI setup do: clear_config([:instance, :federating], true) describe "feed" do setup do: clear_config([:feed]) - test "gets a feed", %{conn: conn} do + test "gets an atom feed", %{conn: conn} do Config.put( [:feed, :post_title], %{max_length: 10, omission: "..."} @@ -157,6 +158,29 @@ defmodule Pleroma.Web.Feed.UserControllerTest do assert response(conn, 404) end + + test "returns feed with public and unlisted activities", %{conn: conn} do + user = insert(:user) + + {:ok, _} = CommonAPI.post(user, %{status: "public", visibility: "public"}) + {:ok, _} = CommonAPI.post(user, %{status: "direct", visibility: "direct"}) + {:ok, _} = CommonAPI.post(user, %{status: "unlisted", visibility: "unlisted"}) + {:ok, _} = CommonAPI.post(user, %{status: "private", visibility: "private"}) + + resp = + conn + |> put_req_header("accept", "application/atom+xml") + |> get(user_feed_path(conn, :feed, user.nickname)) + |> response(200) + + activity_titles = + resp + |> SweetXml.parse() + |> SweetXml.xpath(~x"//entry/title/text()"l) + |> Enum.sort() + + assert activity_titles == ['public', 'unlisted'] + end end # Note: see ActivityPubControllerTest for JSON format tests |