Merge branch 'stable' into develop
[akkoma] / test / pleroma / web / push / impl_test.exs
index d14e0bdefc7855e577455b0471ae1dd9340fb5a6..9100433ae9621241b246bdcba4969875741216bf 100644 (file)
@@ -1,5 +1,5 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.Push.ImplTest do
@@ -7,10 +7,8 @@ defmodule Pleroma.Web.Push.ImplTest do
 
   import Pleroma.Factory
 
-  alias Pleroma.Notification
   alias Pleroma.Object
   alias Pleroma.User
-  alias Pleroma.Web.ActivityPub.ActivityPub
   alias Pleroma.Web.CommonAPI
   alias Pleroma.Web.Push.Impl
   alias Pleroma.Web.Push.Subscription
@@ -216,46 +214,6 @@ defmodule Pleroma.Web.Push.ImplTest do
   end
 
   describe "build_content/3" do
-    test "builds content for chat messages" do
-      user = insert(:user)
-      recipient = insert(:user)
-
-      {:ok, chat} = CommonAPI.post_chat_message(user, recipient, "hey")
-      object = Object.normalize(chat, fetch: false)
-      [notification] = Notification.for_user(recipient)
-
-      res = Impl.build_content(notification, user, object)
-
-      assert res == %{
-               body: "@#{user.nickname}: hey",
-               title: "New Chat Message"
-             }
-    end
-
-    test "builds content for chat messages with no content" do
-      user = insert(:user)
-      recipient = insert(:user)
-
-      file = %Plug.Upload{
-        content_type: "image/jpeg",
-        path: Path.absname("test/fixtures/image.jpg"),
-        filename: "an_image.jpg"
-      }
-
-      {:ok, upload} = ActivityPub.upload(file, actor: user.ap_id)
-
-      {:ok, chat} = CommonAPI.post_chat_message(user, recipient, nil, media_id: upload.id)
-      object = Object.normalize(chat, fetch: false)
-      [notification] = Notification.for_user(recipient)
-
-      res = Impl.build_content(notification, user, object)
-
-      assert res == %{
-               body: "@#{user.nickname}: (Attachment)",
-               title: "New Chat Message"
-             }
-    end
-
     test "hides contents of notifications when option enabled" do
       user = insert(:user, nickname: "Bob")