summaryrefslogtreecommitdiff
path: root/test/web/static_fe/static_fe_controller_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-07-08 13:23:07 +0200
committerlain <lain@soykaf.club>2020-07-08 13:23:07 +0200
commit7d0e2b3fdd001b45741d97ee9c7833a69d6fb5ef (patch)
treedc88ef36e04c083bc3c34255092677af1a81ce55 /test/web/static_fe/static_fe_controller_test.exs
parenta6a12b241fbacd3ff35cd901190e62d14aaac3c2 (diff)
parent6335b32aa8f5c54cf5f09638189a77cad5785077 (diff)
downloadpleroma-7d0e2b3fdd001b45741d97ee9c7833a69d6fb5ef.tar.gz
pleroma-7d0e2b3fdd001b45741d97ee9c7833a69d6fb5ef.zip
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into follow-pipeline
Diffstat (limited to 'test/web/static_fe/static_fe_controller_test.exs')
-rw-r--r--test/web/static_fe/static_fe_controller_test.exs14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/web/static_fe/static_fe_controller_test.exs b/test/web/static_fe/static_fe_controller_test.exs
index a49ab002f..1598bf675 100644
--- a/test/web/static_fe/static_fe_controller_test.exs
+++ b/test/web/static_fe/static_fe_controller_test.exs
@@ -87,6 +87,20 @@ defmodule Pleroma.Web.StaticFE.StaticFEControllerTest 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>"})