status: "hey again @#{other_user.nickname}!"
})
- [n2, n1] = notifs = Notification.for_user(other_user)
- assert length(notifs) == 2
+ [n2, n1] = Notification.for_user(other_user)
assert n2.id > n1.id
status: "hey yet again @#{other_user.nickname}!"
})
- Notification.set_read_up_to(other_user, n2.id)
+ [_, read_notification] = Notification.set_read_up_to(other_user, n2.id)
+
+ assert read_notification.activity.object
[n3, n2, n1] = Notification.for_user(other_user)
status: "hey @#{other_user.nickname}!"
})
- {:ok, activity_two, _} = CommonAPI.repeat(activity_one.id, third_user)
+ {:ok, activity_two} = CommonAPI.repeat(activity_one.id, third_user)
{enabled_receivers, _disabled_receivers} =
Notification.get_notified_from_activity(activity_two)
assert Enum.empty?(Notification.for_user(user))
- {:ok, _, _} = CommonAPI.repeat(activity.id, other_user)
+ {:ok, _} = CommonAPI.repeat(activity.id, other_user)
assert length(Notification.for_user(user)) == 1
assert Enum.empty?(Notification.for_user(user))
- {:ok, _, _} = CommonAPI.repeat(activity.id, other_user)
+ {:ok, _} = CommonAPI.repeat(activity.id, other_user)
assert length(Notification.for_user(user)) == 1
{:ok, _activity} = CommonAPI.post(muted, %{status: "hey @#{user.nickname}"})
- assert length(Notification.for_user(user)) == 1
+ [notification] = Notification.for_user(user)
+
+ assert notification.activity.object
end
test "it doesn't return notifications for muted user with notifications" do