aboutsummaryrefslogtreecommitdiff
path: root/test/web/mastodon_api
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-06-03 12:49:53 +0200
committerlain <lain@soykaf.club>2020-06-03 12:49:53 +0200
commitf3ccd50a33c9eec3661bf2116fe38542f04986aa (patch)
treece52ee1dc979054911d6d508714f13f7cd2a5d2b /test/web/mastodon_api
parentaa22fce8f46cf2e7f871b3584fbfff7ac2ebe4c2 (diff)
downloadpleroma-f3ccd50a33c9eec3661bf2116fe38542f04986aa.tar.gz
ChatMessageReferences: Adjust views
Diffstat (limited to 'test/web/mastodon_api')
-rw-r--r--test/web/mastodon_api/views/notification_view_test.exs7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/web/mastodon_api/views/notification_view_test.exs b/test/web/mastodon_api/views/notification_view_test.exs
index 384fe7253..c5691341a 100644
--- a/test/web/mastodon_api/views/notification_view_test.exs
+++ b/test/web/mastodon_api/views/notification_view_test.exs
@@ -7,6 +7,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do
alias Pleroma.Activity
alias Pleroma.Chat
+ alias Pleroma.ChatMessageReference
alias Pleroma.Notification
alias Pleroma.Object
alias Pleroma.Repo
@@ -16,7 +17,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do
alias Pleroma.Web.MastodonAPI.AccountView
alias Pleroma.Web.MastodonAPI.NotificationView
alias Pleroma.Web.MastodonAPI.StatusView
- alias Pleroma.Web.PleromaAPI.ChatMessageView
+ alias Pleroma.Web.PleromaAPI.ChatMessageReferenceView
import Pleroma.Factory
defp test_notifications_rendering(notifications, user, expected_result) do
@@ -44,13 +45,15 @@ defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do
object = Object.normalize(activity)
chat = Chat.get(recipient.id, user.ap_id)
+ cm_ref = ChatMessageReference.for_chat_and_object(chat, object)
+
expected = %{
id: to_string(notification.id),
pleroma: %{is_seen: false},
type: "pleroma:chat_mention",
account: AccountView.render("show.json", %{user: user, for: recipient}),
chat_message:
- ChatMessageView.render("show.json", %{object: object, for: recipient, chat: chat}),
+ ChatMessageReferenceView.render("show.json", %{chat_message_reference: cm_ref}),
created_at: Utils.to_masto_date(notification.inserted_at)
}