alias Pleroma.Web.CommonAPI
alias Pleroma.Web.Streamer
+ import ExUnit.CaptureLog
+
describe "create_notifications" do
test "notifies someone when they are directly addressed" do
user = insert(: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))
end
{:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"})
{:ok, %Activity{}} = CommonAPI.favorite(user, activity.id)
+
assert capture_log(fn ->
- assert {:error, _} = CommonAPI.favorite(user, activity.id)
- end) =~ "[error]"
+ assert {:error, _} = CommonAPI.favorite(user, activity.id)
+ end) =~ "[error]"
end
end