aboutsummaryrefslogtreecommitdiff
path: root/test/web/feed/user_controller_test.exs
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2020-06-29 16:09:49 +0400
committerEgor Kislitsyn <egor@kislitsyn.com>2020-06-29 16:09:49 +0400
commit4a306720e8be8633e192f7b2c98f129a315939b9 (patch)
treeed5ec059c532777a28eade72f384c8a800ead496 /test/web/feed/user_controller_test.exs
parentd15aa9d9503e59b3cd0731394855781f435ec63c (diff)
parent651f269568cb7e54cd96d8a0d8ea3533f77e9a3a (diff)
downloadpleroma-4a306720e8be8633e192f7b2c98f129a315939b9.tar.gz
Merge branch 'develop' into remove-twitter-api
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