1 defmodule Pleroma.Web.PushTest do
8 test "renders body for create activity" do
9 assert Push.format_body(
16 "<span>Lorem ipsum dolor sit amet</span>, consectetur :bear: adipiscing elit. Fusce sagittis finibus turpis."
23 "@Bob: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sagittis fini..."
26 test "renders body for follow activity" do
27 assert Push.format_body(%{activity: %{data: %{"type" => "Follow"}}}, %{nickname: "Bob"}) ==
28 "@Bob has followed you"
31 test "renders body for announce activity" do
38 "<span>Lorem ipsum dolor sit amet</span>, consectetur :bear: adipiscing elit. Fusce sagittis finibus turpis."
42 note_activity = insert(:note_activity, %{note: note})
43 announce_activity = insert(:announce_activity, %{user: user, note_activity: note_activity})
45 assert Push.format_body(%{activity: announce_activity}, user) ==
46 "@#{user.nickname} repeated: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sagittis fini..."
49 test "renders body for like activity" do
50 assert Push.format_body(%{activity: %{data: %{"type" => "Like"}}}, %{nickname: "Bob"}) ==
51 "@Bob has favorited your post"