mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-30 17:11:40 +00:00
Tests: Capture log.
This commit is contained in:
parent
4ec299ea9c
commit
15bbc34c07
|
@ -14,6 +14,8 @@ defmodule Pleroma.NotificationTest do
|
||||||
alias Pleroma.Web.CommonAPI
|
alias Pleroma.Web.CommonAPI
|
||||||
alias Pleroma.Web.Streamer
|
alias Pleroma.Web.Streamer
|
||||||
|
|
||||||
|
import ExUnit.CaptureLog
|
||||||
|
|
||||||
describe "create_notifications" do
|
describe "create_notifications" do
|
||||||
test "notifies someone when they are directly addressed" do
|
test "notifies someone when they are directly addressed" do
|
||||||
user = insert(:user)
|
user = insert(:user)
|
||||||
|
@ -533,7 +535,9 @@ defmodule Pleroma.NotificationTest do
|
||||||
|
|
||||||
assert Enum.empty?(Notification.for_user(user))
|
assert Enum.empty?(Notification.for_user(user))
|
||||||
|
|
||||||
{:error, _} = CommonAPI.favorite(other_user, activity.id)
|
assert capture_log(fn ->
|
||||||
|
{:error, _} = CommonAPI.favorite(other_user, activity.id)
|
||||||
|
end) =~ "[error]"
|
||||||
|
|
||||||
assert Enum.empty?(Notification.for_user(user))
|
assert Enum.empty?(Notification.for_user(user))
|
||||||
end
|
end
|
||||||
|
|
|
@ -275,9 +275,10 @@ defmodule Pleroma.Web.CommonAPITest do
|
||||||
|
|
||||||
{:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"})
|
{:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"})
|
||||||
{:ok, %Activity{}} = CommonAPI.favorite(user, activity.id)
|
{:ok, %Activity{}} = CommonAPI.favorite(user, activity.id)
|
||||||
|
|
||||||
assert capture_log(fn ->
|
assert capture_log(fn ->
|
||||||
assert {:error, _} = CommonAPI.favorite(user, activity.id)
|
assert {:error, _} = CommonAPI.favorite(user, activity.id)
|
||||||
end) =~ "[error]"
|
end) =~ "[error]"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue