diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2020-07-02 05:45:19 +0200 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2020-07-15 12:32:43 +0200 |
commit | e4beff90f5670876184b2593c1b4a49f2339d048 (patch) | |
tree | dca182e4aa12bb0ecf5502ea6d150e3037675c39 /test | |
parent | 922ca232988b90b7a4fb5918bb76c383c90fd770 (diff) | |
download | pleroma-e4beff90f5670876184b2593c1b4a49f2339d048.tar.gz |
Create Question: Add context field to create
Diffstat (limited to 'test')
-rw-r--r-- | test/web/activity_pub/transmogrifier/question_handling_test.exs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/web/activity_pub/transmogrifier/question_handling_test.exs b/test/web/activity_pub/transmogrifier/question_handling_test.exs index fba8106b5..12516c4ab 100644 --- a/test/web/activity_pub/transmogrifier/question_handling_test.exs +++ b/test/web/activity_pub/transmogrifier/question_handling_test.exs @@ -8,6 +8,9 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.QuestionHandlingTest do alias Pleroma.Activity alias Pleroma.Object alias Pleroma.Web.ActivityPub.Transmogrifier + alias Pleroma.Web.CommonAPI + + import Pleroma.Factory setup_all do Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end) @@ -23,6 +26,8 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.QuestionHandlingTest do assert object.data["closed"] == "2019-05-11T09:03:36Z" + assert object.data["context"] == activity.data["context"] + assert object.data["context"] == "tag:mastodon.sdf.org,2019-05-10:objectId=15095122:objectType=Conversation" @@ -53,6 +58,15 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.QuestionHandlingTest do "type" => "Note" } ]) + + user = insert(:user) + + {:ok, reply_activity} = CommonAPI.post(user, %{status: "hewwo", in_reply_to_id: activity.id}) + + reply_object = Object.normalize(reply_activity, false) + + assert reply_object.data["context"] == object.data["context"] + assert reply_object.data["context_id"] == object.data["context_id"] end test "Mastodon Question activity with HTML tags in plaintext" do |