summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/object/containment_test.exs10
-rw-r--r--test/web/static_fe/static_fe_controller_test.exs4
2 files changed, 12 insertions, 2 deletions
diff --git a/test/object/containment_test.exs b/test/object/containment_test.exs
index 71fe5204c..7636803a6 100644
--- a/test/object/containment_test.exs
+++ b/test/object/containment_test.exs
@@ -17,6 +17,16 @@ defmodule Pleroma.Object.ContainmentTest do
end
describe "general origin containment" do
+ test "works for completely actorless posts" do
+ assert :error ==
+ Containment.contain_origin("https://glaceon.social/users/monorail", %{
+ "deleted" => "2019-10-30T05:48:50.249606Z",
+ "formerType" => "Note",
+ "id" => "https://glaceon.social/users/monorail/statuses/103049757364029187",
+ "type" => "Tombstone"
+ })
+ end
+
test "contain_origin_from_id() catches obvious spoofing attempts" do
data = %{
"id" => "http://example.com/~alyssa/activities/1234.json"
diff --git a/test/web/static_fe/static_fe_controller_test.exs b/test/web/static_fe/static_fe_controller_test.exs
index effdfbeb3..b8fb67b22 100644
--- a/test/web/static_fe/static_fe_controller_test.exs
+++ b/test/web/static_fe/static_fe_controller_test.exs
@@ -151,7 +151,7 @@ defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do
assert html_response(conn, 404) =~ "not found"
end
- test "404 for remote cached status", %{conn: conn} do
+ test "302 for remote cached status", %{conn: conn} do
user = insert(:user)
message = %{
@@ -175,7 +175,7 @@ defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do
|> put_req_header("accept", "text/html")
|> get("/notice/#{activity.id}")
- assert html_response(conn, 404) =~ "not found"
+ assert html_response(conn, 302) =~ "redirected"
end
end
end