X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fmarker_test.exs;h=5b6d0b4a4729b4af0886fefb25f013222a7eefe7;hb=f5845ff03395816902a637a28412f85e671575e7;hp=7b1d2218ab0f57c566a70e61472450d1d41f5069;hpb=b87533760bb386e85eb8c806e1d242d2b1380971;p=akkoma
diff --git a/test/marker_test.exs b/test/marker_test.exs
index 7b1d2218a..5b6d0b4a4 100644
--- a/test/marker_test.exs
+++ b/test/marker_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.MarkerTest do
@@ -15,7 +15,7 @@ defmodule Pleroma.MarkerTest do
assert %Ecto.Multi{
operations: [marker: {:run, _}, counters: {:run, _}]
} =
- Marker.multi_set_unread_count(
+ Marker.multi_set_last_read_id(
Ecto.Multi.new(),
user,
"notifications"
@@ -25,19 +25,12 @@ defmodule Pleroma.MarkerTest do
test "return empty multi" do
user = insert(:user)
multi = Ecto.Multi.new()
- assert Marker.multi_set_unread_count(multi, user, "home") == multi
+ assert Marker.multi_set_last_read_id(multi, user, "home") == multi
end
end
describe "get_markers/2" do
test "returns user markers" do
- user = insert(:user)
- marker = insert(:marker, user: user)
- insert(:marker, timeline: "home", user: user)
- assert Marker.get_markers(user, ["notifications"]) == [refresh_record(marker)]
- end
-
- test "returns user markers with recount unread notifications" do
user = insert(:user)
marker = insert(:marker, user: user)
insert(:notification, user: user)
@@ -46,8 +39,7 @@ defmodule Pleroma.MarkerTest do
assert Marker.get_markers(
user,
- ["notifications"],
- %{recount_unread: true}
+ ["notifications"]
) == [%Marker{refresh_record(marker) | unread_count: 2}]
end
end