aboutsummaryrefslogtreecommitdiff
path: root/test/web/controller/frontend
diff options
context:
space:
mode:
authorRoman Chvanikov <chvanikoff@pm.me>2020-07-09 16:56:06 +0300
committerRoman Chvanikov <chvanikoff@pm.me>2020-07-09 16:56:06 +0300
commit17a2ff57ac589b6fb996583f38f542b365b01ccf (patch)
treedd19dc053927147c5b28742b1b2fbb743bcbb650 /test/web/controller/frontend
parent3ce21ff4e8cc0d3c1a7481082fe574e1f9ff6466 (diff)
parent8ca1f3e8c61b906387e9cb6fb8993d2ad496ab3d (diff)
downloadpleroma-17a2ff57ac589b6fb996583f38f542b365b01ccf.tar.gz
merge develop
Diffstat (limited to 'test/web/controller/frontend')
-rw-r--r--test/web/controller/frontend/static_controller_test.exs14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/web/controller/frontend/static_controller_test.exs b/test/web/controller/frontend/static_controller_test.exs
index cc328ca64..ac447341b 100644
--- a/test/web/controller/frontend/static_controller_test.exs
+++ b/test/web/controller/frontend/static_controller_test.exs
@@ -94,6 +94,20 @@ defmodule Pleroma.Web.Frontend.StaticControllerTest do
assert html =~ "testing a thing!"
end
+ test "redirects to json if requested", %{conn: conn, user: user} do
+ {:ok, activity} = CommonAPI.post(user, %{status: "testing a thing!"})
+
+ conn =
+ conn
+ |> put_req_header(
+ "accept",
+ "Accept: application/activity+json, application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\", text/html"
+ )
+ |> get("/notice/#{activity.id}")
+
+ assert redirected_to(conn, 302) =~ activity.data["object"]
+ end
+
test "filters HTML tags", %{conn: conn} do
user = insert(:user)
{:ok, activity} = CommonAPI.post(user, %{status: "<script>alert('xss')</script>"})