X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fweb%2Fcommon_api_test.exs;h=20870bdd70ed87b813ea25ba3b4a522fc18d5718;hb=829ae13572d051e965dfa9aedeb64753481b5f2b;hp=a5dfd39342e0776954aff9b44233518d7ff55fd6;hpb=b83758bd9634d4f2fb70a92159072dd44e49bb31;p=akkoma diff --git a/test/pleroma/web/common_api_test.exs b/test/pleroma/web/common_api_test.exs index a5dfd3934..20870bdd7 100644 --- a/test/pleroma/web/common_api_test.exs +++ b/test/pleroma/web/common_api_test.exs @@ -18,6 +18,7 @@ defmodule Pleroma.Web.CommonAPITest do alias Pleroma.Web.ActivityPub.Visibility alias Pleroma.Web.AdminAPI.AccountView alias Pleroma.Web.CommonAPI + alias Pleroma.Workers.PollWorker import Pleroma.Factory import Mock @@ -48,6 +49,12 @@ defmodule Pleroma.Web.CommonAPITest do assert object.data["type"] == "Question" assert object.data["oneOf"] |> length() == 2 + + assert_enqueued( + worker: PollWorker, + args: %{op: "poll_end", activity_id: activity.id}, + scheduled_at: NaiveDateTime.from_iso8601!(object.data["closed"]) + ) end end @@ -202,9 +209,7 @@ defmodule Pleroma.Web.CommonAPITest do object = Object.normalize(activity, fetch: false) assert object.data["content"] == - "https://example.org is the site of @#{other_user.nickname} #2hu" + "https://example.org is the site of @#{other_user.nickname} #2hu" end test "it posts a chat message" do @@ -581,7 +586,11 @@ defmodule Pleroma.Web.CommonAPITest do object = Object.normalize(activity, fetch: false) assert object.data["content"] == "

2hu

alert('xss')" - assert object.data["source"] == post + + assert object.data["source"] == %{ + "mediaType" => "text/html", + "content" => post + } end test "it filters out obviously bad tags when accepting a post as Markdown" do @@ -598,7 +607,11 @@ defmodule Pleroma.Web.CommonAPITest do object = Object.normalize(activity, fetch: false) assert object.data["content"] == "

2hu

" - assert object.data["source"] == post + + assert object.data["source"] == %{ + "mediaType" => "text/markdown", + "content" => post + } end test "it does not allow replies to direct messages that are not direct messages themselves" do