summaryrefslogtreecommitdiff
path: root/test/web/feed/user_controller_test.exs
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2020-06-01 17:38:57 +0400
committerEgor Kislitsyn <egor@kislitsyn.com>2020-06-01 17:38:57 +0400
commit6b84c62d4a51cb17192945d1b67999b2c56a23d2 (patch)
tree53744600bd910bb0a62be6ab5884c6972da2ffce /test/web/feed/user_controller_test.exs
parentcb8236cda62cddb72f4320af6347defae44b81ca (diff)
parente96765df6b04fe5e9766271a9c62e559392758b2 (diff)
downloadpleroma-6b84c62d4a51cb17192945d1b67999b2c56a23d2.tar.gz
pleroma-6b84c62d4a51cb17192945d1b67999b2c56a23d2.zip
Merge remote-tracking branch 'origin/develop' into feature/embeddable-posts
Diffstat (limited to 'test/web/feed/user_controller_test.exs')
-rw-r--r--test/web/feed/user_controller_test.exs26
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