projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into feature/database-compaction
[akkoma]
/
test
/
web
/
common_api
/
common_api_test.exs
diff --git
a/test/web/common_api/common_api_test.exs
b/test/web/common_api/common_api_test.exs
index 34aa5bf1884f949c9a8642ffba4a5dc2c07cb6f6..b9ed088e41c6600f736ed5fa865e2d264df2f356 100644
(file)
--- a/
test/web/common_api/common_api_test.exs
+++ b/
test/web/common_api/common_api_test.exs
@@
-6,6
+6,7
@@
defmodule Pleroma.Web.CommonAPITest do
use Pleroma.DataCase
alias Pleroma.Activity
alias Pleroma.User
use Pleroma.DataCase
alias Pleroma.Activity
alias Pleroma.User
+ alias Pleroma.Object
alias Pleroma.Web.CommonAPI
import Pleroma.Factory
alias Pleroma.Web.CommonAPI
import Pleroma.Factory
@@
-32,7
+33,9
@@
defmodule Pleroma.Web.CommonAPITest do
user = insert(:user)
{:ok, activity} = CommonAPI.post(user, %{"status" => "#2hu #2HU"})
user = insert(:user)
{:ok, activity} = CommonAPI.post(user, %{"status" => "#2hu #2HU"})
- assert activity.data["object"]["tag"] == ["2hu"]
+ object = Object.normalize(activity.data["object"])
+
+ assert object.data["tag"] == ["2hu"]
end
test "it adds emoji in the object" do
end
test "it adds emoji in the object" do
@@
-64,8
+67,9
@@
defmodule Pleroma.Web.CommonAPITest do
"content_type" => "text/html"
})
"content_type" => "text/html"
})
- content = activity.data["object"]["content"]
- assert content == "<p><b>2hu</b></p>alert('xss')"
+ object = Object.normalize(activity.data["object"])
+
+ assert object.data["content"] == "<p><b>2hu</b></p>alert('xss')"
end
test "it filters out obviously bad tags when accepting a post as Markdown" do
end
test "it filters out obviously bad tags when accepting a post as Markdown" do
@@
-79,8
+83,9
@@
defmodule Pleroma.Web.CommonAPITest do
"content_type" => "text/markdown"
})
"content_type" => "text/markdown"
})
- content = activity.data["object"]["content"]
- assert content == "<p><b>2hu</b></p>alert('xss')"
+ object = Object.normalize(activity.data["object"])
+
+ assert object.data["content"] == "<p><b>2hu</b></p>alert('xss')"
end
end
end
end