aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPhil Hagelberg <phil@hagelb.org>2019-11-12 17:19:46 -0800
committerPhil Hagelberg <phil@hagelb.org>2019-11-13 08:02:02 -0800
commit0867cb083eb469ae10cd48d424a51efb2fae4018 (patch)
tree2cbd8ec8bca47859823e98409cda01c227b69766 /test
parent60cc5a775084fbd9362b7e682887d0c44caf5175 (diff)
downloadpleroma-0867cb083eb469ae10cd48d424a51efb2fae4018.tar.gz
Support redirecting by object ID in static FE.
This matches the behavior of pleroma-fe better. Fixes #1412.
Diffstat (limited to 'test')
-rw-r--r--test/web/static_fe/static_fe_controller_test.exs15
1 files changed, 15 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 b8fb67b22..6ea8cea34 100644
--- a/test/web/static_fe/static_fe_controller_test.exs
+++ b/test/web/static_fe/static_fe_controller_test.exs
@@ -1,5 +1,6 @@
defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do
use Pleroma.Web.ConnCase
+ alias Pleroma.Activity
alias Pleroma.Web.ActivityPub.Transmogrifier
alias Pleroma.Web.CommonAPI
@@ -128,6 +129,20 @@ defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do
assert html =~ "voyages"
end
+ test "redirect by AP object ID", %{conn: conn} do
+ user = insert(:user)
+
+ {:ok, %Activity{data: %{"object" => object_url}}} =
+ CommonAPI.post(user, %{"status" => "beam me up"})
+
+ conn =
+ conn
+ |> put_req_header("accept", "text/html")
+ |> get(URI.parse(object_url).path)
+
+ assert html_response(conn, 302) =~ "redirected"
+ end
+
test "404 when notice not found", %{conn: conn} do
conn =
conn