diff options
author | Alex Gleason <alex@alexgleason.me> | 2021-05-05 13:58:50 -0500 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2021-05-05 14:50:10 -0500 |
commit | 50e3750758510a2790ce6229d9194ace72d1e012 (patch) | |
tree | e69c3d2cbcc3b3fe59de098601a78a1cf0693f5d /test | |
parent | b221d77a6da07c684bdbc63ddf4500e0d7ffeae8 (diff) | |
download | pleroma-50e3750758510a2790ce6229d9194ace72d1e012.tar.gz pleroma-50e3750758510a2790ce6229d9194ace72d1e012.zip |
Add notice compatibility routes for other frontends
Fixes: https://git.pleroma.social/pleroma/pleroma/-/issues/1785
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/web/o_status/o_status_controller_test.exs | 50 | ||||
-rw-r--r-- | test/pleroma/web/plugs/frontend_static_plug_test.exs | 2 |
2 files changed, 52 insertions, 0 deletions
diff --git a/test/pleroma/web/o_status/o_status_controller_test.exs b/test/pleroma/web/o_status/o_status_controller_test.exs index 2038f4ddd..fab042439 100644 --- a/test/pleroma/web/o_status/o_status_controller_test.exs +++ b/test/pleroma/web/o_status/o_status_controller_test.exs @@ -343,4 +343,54 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do |> response(200) end end + + describe "notice compatibility routes" do + test "Soapbox FE", %{conn: conn} do + user = insert(:user) + note_activity = insert(:note_activity, user: user) + + resp = + conn + |> put_req_header("accept", "text/html") + |> get("/@#{user.nickname}/posts/#{note_activity.id}") + |> response(200) + + expected = + "<meta content=\"#{Pleroma.Web.base_url()}/notice/#{note_activity.id}\" property=\"og:url\">" + + assert resp =~ expected + end + + test "Mastodon", %{conn: conn} do + user = insert(:user) + note_activity = insert(:note_activity, user: user) + + resp = + conn + |> put_req_header("accept", "text/html") + |> get("/@#{user.nickname}/#{note_activity.id}") + |> response(200) + + expected = + "<meta content=\"#{Pleroma.Web.base_url()}/notice/#{note_activity.id}\" property=\"og:url\">" + + assert resp =~ expected + end + + test "Twitter", %{conn: conn} do + user = insert(:user) + note_activity = insert(:note_activity, user: user) + + resp = + conn + |> put_req_header("accept", "text/html") + |> get("/#{user.nickname}/status/#{note_activity.id}") + |> response(200) + + expected = + "<meta content=\"#{Pleroma.Web.base_url()}/notice/#{note_activity.id}\" property=\"og:url\">" + + assert resp =~ expected + end + end end diff --git a/test/pleroma/web/plugs/frontend_static_plug_test.exs b/test/pleroma/web/plugs/frontend_static_plug_test.exs index 100b83d6a..7596a9a54 100644 --- a/test/pleroma/web/plugs/frontend_static_plug_test.exs +++ b/test/pleroma/web/plugs/frontend_static_plug_test.exs @@ -86,6 +86,8 @@ defmodule Pleroma.Web.Plugs.FrontendStaticPlugTest do "objects", "activities", "notice", + "@:nickname", + ":nickname", "users", "tags", "mailer", |