diff options
author | lain <lain@soykaf.club> | 2019-07-31 15:12:29 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-07-31 15:12:29 +0200 |
commit | 7483679a7b6ff63c9c61c3df3e9e37f2c24012ff (patch) | |
tree | 005c9778b7debe4fc43ff7fe3761fa6a669ff14f /test | |
parent | 677df5ceb370a22fa8df44e6ce5f6fa47d91f9b8 (diff) | |
download | pleroma-7483679a7b6ff63c9c61c3df3e9e37f2c24012ff.tar.gz |
StatusView: Return direct conversation id.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/mastodon_api/status_view_test.exs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs index 0b167f839..c983b494f 100644 --- a/test/web/mastodon_api/status_view_test.exs +++ b/test/web/mastodon_api/status_view_test.exs @@ -23,6 +23,21 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do :ok end + test "returns the direct conversation id when given the `with_conversation_id` option" do + user = insert(:user) + + {:ok, activity} = CommonAPI.post(user, %{"status" => "Hey @shp!", "visibility" => "direct"}) + + status = + StatusView.render("status.json", + activity: activity, + with_direct_conversation_id: true, + for: user + ) + + assert status[:pleroma][:direct_conversation_id] + end + test "returns a temporary ap_id based user for activities missing db users" do user = insert(:user) @@ -133,7 +148,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do conversation_id: convo_id, in_reply_to_account_acct: nil, content: %{"text/plain" => HtmlSanitizeEx.strip_tags(object_data["content"])}, - spoiler_text: %{"text/plain" => HtmlSanitizeEx.strip_tags(object_data["summary"])} + spoiler_text: %{"text/plain" => HtmlSanitizeEx.strip_tags(object_data["summary"])}, + direct_conversation_id: nil } } |