diff options
author | kaniini <nenolod@gmail.com> | 2019-04-19 16:55:33 +0000 |
---|---|---|
committer | kaniini <nenolod@gmail.com> | 2019-04-19 16:55:33 +0000 |
commit | 9da8b287f8a2c1fda2ca05351d5418321510472b (patch) | |
tree | ef85c774a5450fadc30f9ad2e5beaaca11e2bf02 /test/web/common_api/common_api_test.exs | |
parent | cc93775ebf539598075c0b9afb96c60c8bede6b5 (diff) | |
parent | f9865cf9439e2e9273f55d3b82c1e68166178b07 (diff) | |
download | pleroma-9da8b287f8a2c1fda2ca05351d5418321510472b.tar.gz pleroma-9da8b287f8a2c1fda2ca05351d5418321510472b.zip |
Merge branch 'feature/database-compaction' into 'develop'
database compaction
See merge request pleroma/pleroma!473
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r-- | test/web/common_api/common_api_test.exs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index 34aa5bf18..3d2bb8929 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -5,6 +5,7 @@ defmodule Pleroma.Web.CommonAPITest do use Pleroma.DataCase alias Pleroma.Activity + alias Pleroma.Object alias Pleroma.User alias Pleroma.Web.CommonAPI @@ -32,14 +33,16 @@ defmodule Pleroma.Web.CommonAPITest do 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 user = insert(:user) {:ok, activity} = CommonAPI.post(user, %{"status" => ":moominmamma:"}) - assert activity.data["object"]["emoji"]["moominmamma"] + assert Object.normalize(activity).data["emoji"]["moominmamma"] end test "it adds emoji when updating profiles" do @@ -64,8 +67,9 @@ defmodule Pleroma.Web.CommonAPITest do "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 @@ -79,8 +83,9 @@ defmodule Pleroma.Web.CommonAPITest do "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 |