diff options
| author | lain <lain@soykaf.club> | 2019-10-18 12:44:53 +0200 | 
|---|---|---|
| committer | lain <lain@soykaf.club> | 2019-10-18 12:44:53 +0200 | 
| commit | 15bbc34c079018f1c988fe9d445bec50e85bbeaf (patch) | |
| tree | 9235ff42e4a72cebfa8b33adf7c0086fb899ca87 /test | |
| parent | 4ec299ea9c1cf45c42e98d7b33f33a72f5e7a9c0 (diff) | |
| download | pleroma-15bbc34c079018f1c988fe9d445bec50e85bbeaf.tar.gz pleroma-15bbc34c079018f1c988fe9d445bec50e85bbeaf.zip | |
Tests: Capture log.
Diffstat (limited to 'test')
| -rw-r--r-- | test/notification_test.exs | 6 | ||||
| -rw-r--r-- | test/web/common_api/common_api_test.exs | 5 | 
2 files changed, 8 insertions, 3 deletions
| diff --git a/test/notification_test.exs b/test/notification_test.exs index 940913aa6..480c9415b 100644 --- a/test/notification_test.exs +++ b/test/notification_test.exs @@ -14,6 +14,8 @@ defmodule Pleroma.NotificationTest do    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) @@ -533,7 +535,9 @@ defmodule Pleroma.NotificationTest do        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 diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index 63d7ea79f..8195b1910 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -275,9 +275,10 @@ defmodule Pleroma.Web.CommonAPITest do        {: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 | 
