aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRoman Chvanikov <chvanikoff@gmail.com>2019-04-17 16:59:05 +0700
committerRoman Chvanikov <chvanikoff@gmail.com>2019-04-17 16:59:05 +0700
commit2f0203a4a1c7a507aa5cf50be2fd372536ebfc81 (patch)
tree8219ebfbfffb47ffff5649dfe428c501a4ccb089 /test
parent87013f843853250e8b15696900e09afb92d22aac (diff)
downloadpleroma-2f0203a4a1c7a507aa5cf50be2fd372536ebfc81.tar.gz
Resolve conflicts
Diffstat (limited to 'test')
-rw-r--r--test/notification_test.exs22
1 files changed, 14 insertions, 8 deletions
diff --git a/test/notification_test.exs b/test/notification_test.exs
index 907b9e669..27d8cace7 100644
--- a/test/notification_test.exs
+++ b/test/notification_test.exs
@@ -4,12 +4,15 @@
defmodule Pleroma.NotificationTest do
use Pleroma.DataCase
+
+ import Pleroma.Factory
+ import Mock
+
alias Pleroma.Notification
alias Pleroma.User
alias Pleroma.Web.ActivityPub.Transmogrifier
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.TwitterAPI.TwitterAPI
- import Pleroma.Factory
describe "create_notifications" do
test "notifies someone when they are directly addressed" do
@@ -312,16 +315,19 @@ defmodule Pleroma.NotificationTest do
})
end)
- Process.sleep(1000)
-
[notification | _] = Notification.for_user(user2)
- Notification.set_read_up_to(user2, notification.id)
+ utc_now = NaiveDateTime.utc_now()
+ future = NaiveDateTime.add(utc_now, 5, :second)
- Notification.for_user(user2)
- |> Enum.each(fn notification ->
- assert notification.updated_at > notification.inserted_at
- end)
+ with_mock NaiveDateTime, utc_now: fn -> future end do
+ Notification.set_read_up_to(user2, notification.id)
+
+ Notification.for_user(user2)
+ |> Enum.each(fn notification ->
+ assert notification.updated_at > notification.inserted_at
+ end)
+ end
end
end