diff options
author | lain <lain@soykaf.club> | 2019-11-05 15:21:00 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-11-05 15:21:00 +0100 |
commit | 1bd1f62af55e01613e6362661b36a19091c87424 (patch) | |
tree | 519963a50af82c1a0b251f1405d663ba9ccd4714 /test/web/push/impl_test.exs | |
parent | faced6236b9e2ce9675cf743068f16098b744562 (diff) | |
parent | f11eebc18383be7d7b4b037582e4e1e08b74653b (diff) | |
download | pleroma-1bd1f62af55e01613e6362661b36a19091c87424.tar.gz |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel
Diffstat (limited to 'test/web/push/impl_test.exs')
-rw-r--r-- | test/web/push/impl_test.exs | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/test/web/push/impl_test.exs b/test/web/push/impl_test.exs index 36c69c7c9..37c45eda6 100644 --- a/test/web/push/impl_test.exs +++ b/test/web/push/impl_test.exs @@ -84,7 +84,7 @@ defmodule Pleroma.Web.Push.ImplTest do ) == :error end - test "delete subsciption if restult send message between 400..500" do + test "delete subscription if result send message between 400..500" do subscription = insert(:push_subscription) assert Impl.push_message( @@ -97,7 +97,7 @@ defmodule Pleroma.Web.Push.ImplTest do refute Pleroma.Repo.get(Subscription, subscription.id) end - test "renders body for create activity" do + test "renders title and body for create activity" do user = insert(:user, nickname: "Bob") {:ok, activity} = @@ -116,18 +116,24 @@ defmodule Pleroma.Web.Push.ImplTest do object ) == "@Bob: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sagittis fini..." + + assert Impl.format_title(%{activity: activity}) == + "New Mention" end - test "renders body for follow activity" do + test "renders title and body for follow activity" do user = insert(:user, nickname: "Bob") other_user = insert(:user) {:ok, _, _, activity} = CommonAPI.follow(user, other_user) object = Object.normalize(activity) assert Impl.format_body(%{activity: activity}, user, object) == "@Bob has followed you" + + assert Impl.format_title(%{activity: activity}) == + "New Follower" end - test "renders body for announce activity" do + test "renders title and body for announce activity" do user = insert(:user) {:ok, activity} = @@ -141,9 +147,12 @@ defmodule Pleroma.Web.Push.ImplTest do assert Impl.format_body(%{activity: announce_activity}, user, object) == "@#{user.nickname} repeated: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sagittis fini..." + + assert Impl.format_title(%{activity: announce_activity}) == + "New Repeat" end - test "renders body for like activity" do + test "renders title and body for like activity" do user = insert(:user, nickname: "Bob") {:ok, activity} = @@ -156,5 +165,21 @@ defmodule Pleroma.Web.Push.ImplTest do object = Object.normalize(activity) assert Impl.format_body(%{activity: activity}, user, object) == "@Bob has favorited your post" + + assert Impl.format_title(%{activity: activity}) == + "New Favorite" + end + + test "renders title for create activity with direct visibility" do + user = insert(:user, nickname: "Bob") + + {:ok, activity} = + CommonAPI.post(user, %{ + "visibility" => "direct", + "status" => "This is just between you and me, pal" + }) + + assert Impl.format_title(%{activity: activity}) == + "New Direct Message" end end |