diff options
author | feld <feld@feld.me> | 2022-03-01 19:02:28 +0000 |
---|---|---|
committer | feld <feld@feld.me> | 2022-03-01 19:02:28 +0000 |
commit | 9c52a496f7096f328544ba8bae39e91566f9d7c1 (patch) | |
tree | df548f6ba13a52c971094a6c46b0528558deb5df /test | |
parent | ee05abe052a0e56faf67711362b270893a4ab703 (diff) | |
download | pleroma-9c52a496f7096f328544ba8bae39e91566f9d7c1.tar.gz |
Revert "Merge branch 'revert/notice-routes' into 'develop'"
This reverts merge request !3576
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 81d669837..41aef98b1 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=\"#{Endpoint.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=\"#{Endpoint.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=\"#{Endpoint.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 52379b86a..4b3925ad2 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", |