[#878] Refactored assumptions on embedded object presence in tests. Adjusted note factory to not embed object into activity.

This commit is contained in:
Ivan Tashkinov 2019-07-08 19:53:02 +03:00
commit daff85a985
17 changed files with 164 additions and 138 deletions

View file

@ -34,7 +34,7 @@ defmodule Pleroma.Web.CommonAPITest do
user = insert(:user)
{:ok, activity} = CommonAPI.post(user, %{"status" => "#2hu #2HU"})
object = Object.normalize(activity.data["object"])
object = Object.normalize(activity)
assert object.data["tag"] == ["2hu"]
end
@ -87,7 +87,7 @@ defmodule Pleroma.Web.CommonAPITest do
"content_type" => "text/html"
})
object = Object.normalize(activity.data["object"])
object = Object.normalize(activity)
assert object.data["content"] == "<p><b>2hu</b></p>alert('xss')"
end
@ -103,7 +103,7 @@ defmodule Pleroma.Web.CommonAPITest do
"content_type" => "text/markdown"
})
object = Object.normalize(activity.data["object"])
object = Object.normalize(activity)
assert object.data["content"] == "<p><b>2hu</b></p>alert('xss')"
end