forked from AkkomaGang/akkoma
Inject fake application metadata and validate it is stripped by transmogrifier
This commit is contained in:
parent
9b61df1fb6
commit
3554a65f45
2 changed files with 8 additions and 2 deletions
|
@ -18,7 +18,8 @@ defmodule Pleroma.Constants do
|
||||||
"emoji",
|
"emoji",
|
||||||
"context_id",
|
"context_id",
|
||||||
"deleted_activity_id",
|
"deleted_activity_id",
|
||||||
"pleroma_internal"
|
"pleroma_internal",
|
||||||
|
"application"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -202,7 +202,11 @@ test "it strips internal hashtag data" do
|
||||||
test "it strips internal fields" do
|
test "it strips internal fields" do
|
||||||
user = insert(:user)
|
user = insert(:user)
|
||||||
|
|
||||||
{:ok, activity} = CommonAPI.post(user, %{status: "#2hu :firefox:"})
|
{:ok, activity} =
|
||||||
|
CommonAPI.post(user, %{
|
||||||
|
status: "#2hu :firefox:",
|
||||||
|
application: %{name: "TestClient", website: "https://pleroma.social"}
|
||||||
|
})
|
||||||
|
|
||||||
{:ok, modified} = Transmogrifier.prepare_outgoing(activity.data)
|
{:ok, modified} = Transmogrifier.prepare_outgoing(activity.data)
|
||||||
|
|
||||||
|
@ -213,6 +217,7 @@ test "it strips internal fields" do
|
||||||
assert is_nil(modified["object"]["announcements"])
|
assert is_nil(modified["object"]["announcements"])
|
||||||
assert is_nil(modified["object"]["announcement_count"])
|
assert is_nil(modified["object"]["announcement_count"])
|
||||||
assert is_nil(modified["object"]["context_id"])
|
assert is_nil(modified["object"]["context_id"])
|
||||||
|
assert is_nil(modified["object"]["application"])
|
||||||
end
|
end
|
||||||
|
|
||||||
test "it strips internal fields of article" do
|
test "it strips internal fields of article" do
|
||||||
|
|
Loading…
Reference in a new issue