tests: add legal boilerplate
[akkoma] / test / web / activity_pub / activity_pub_test.exs
index 1d561d38d273301115cc4324bf2271e64e90fd98..4f6b7f058127413e50c68625308234dc6e600e5e 100644 (file)
@@ -1,3 +1,7 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
 defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
   use Pleroma.DataCase
   alias Pleroma.Web.ActivityPub.ActivityPub
@@ -7,6 +11,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
   alias Pleroma.Builders.ActivityBuilder
 
   import Pleroma.Factory
+  import Tesla.Mock
+
+  setup do
+    mock(fn env -> apply(HttpRequestMock, :request, [env]) end)
+    :ok
+  end
 
   describe "building a user from his ap id" do
     test "it returns a user" do
@@ -174,7 +184,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
     test "doesn't retrieve unlisted activities" do
       user = insert(:user)
 
-      {:ok, unlisted_activity} =
+      {:ok, _unlisted_activity} =
         CommonAPI.post(user, %{"status" => "yeah", "visibility" => "unlisted"})
 
       {:ok, listed_activity} = CommonAPI.post(user, %{"status" => "yeah"})