diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2019-10-23 22:48:04 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2019-10-23 22:48:04 +0300 |
commit | d3fb9e02cc0ce7dc462e587e639e117aaef5fbc5 (patch) | |
tree | 37488507f02036d616bc1c9a52d691a77ae1c28d /test | |
parent | aa64b3108ba6aa4294e541e86da323ba1e1a7243 (diff) | |
download | pleroma-d3fb9e02cc0ce7dc462e587e639e117aaef5fbc5.tar.gz |
add tests
Diffstat (limited to 'test')
-rw-r--r-- | test/marker_test.exs | 15 | ||||
-rw-r--r-- | test/notification_test.exs | 3 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test/marker_test.exs b/test/marker_test.exs index 04bd67fe6..1900ed08b 100644 --- a/test/marker_test.exs +++ b/test/marker_test.exs @@ -8,6 +8,21 @@ defmodule Pleroma.MarkerTest do import Pleroma.Factory + describe "multi_set_unread_count/3" do + test "returns multi" do + user = insert(:user) + + assert %Ecto.Multi{ + operations: [marker: {:run, _}, counters: {:run, _}] + } = + Marker.multi_set_unread_count( + Ecto.Multi.new(), + user, + "notifications" + ) + end + end + describe "get_markers/2" do test "returns user markers" do user = insert(:user) diff --git a/test/notification_test.exs b/test/notification_test.exs index 558ac358c..1e8a9ca98 100644 --- a/test/notification_test.exs +++ b/test/notification_test.exs @@ -31,6 +31,9 @@ defmodule Pleroma.NotificationTest do assert notified_ids == [other_user.id, third_user.id] assert notification.activity_id == activity.id assert other_notification.activity_id == activity.id + + assert [%Pleroma.Marker{unread_count: 2}] = + Pleroma.Marker.get_markers(other_user, ["notifications"]) end test "it creates a notification for subscribed users" do |