summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLain Soykaf <lain@lain.com>2023-12-11 10:54:11 +0400
committerLain Soykaf <lain@lain.com>2023-12-11 10:54:11 +0400
commitdec524e7da2fe9594b645c452c42f37da5ee035f (patch)
tree6c947c2f53379d5b595bb9ff45842737c3d78dcf
parent82beb4987a09d44c29a0008da3211f408ed4aced (diff)
downloadpleroma-dec524e7da2fe9594b645c452c42f37da5ee035f.tar.gz
pleroma-dec524e7da2fe9594b645c452c42f37da5ee035f.zip
BackupViewTest: Fix Tests
-rw-r--r--test/pleroma/web/mastodon_api/views/scheduled_activity_view_test.exs7
-rw-r--r--test/pleroma/web/pleroma_api/views/backup_view_test.exs11
2 files changed, 18 insertions, 0 deletions
diff --git a/test/pleroma/web/mastodon_api/views/scheduled_activity_view_test.exs b/test/pleroma/web/mastodon_api/views/scheduled_activity_view_test.exs
index 07a65a3bc..30b38c6c5 100644
--- a/test/pleroma/web/mastodon_api/views/scheduled_activity_view_test.exs
+++ b/test/pleroma/web/mastodon_api/views/scheduled_activity_view_test.exs
@@ -4,12 +4,16 @@
defmodule Pleroma.Web.MastodonAPI.ScheduledActivityViewTest do
use Pleroma.DataCase, async: true
+
alias Pleroma.ScheduledActivity
+ alias Pleroma.UnstubbedConfigMock, as: ConfigMock
alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.CommonAPI.Utils
alias Pleroma.Web.MastodonAPI.ScheduledActivityView
alias Pleroma.Web.MastodonAPI.StatusView
+
+ import Mox
import Pleroma.Factory
test "A scheduled activity with a media attachment" do
@@ -27,6 +31,9 @@ defmodule Pleroma.Web.MastodonAPI.ScheduledActivityViewTest do
filename: "an_image.jpg"
}
+ ConfigMock
+ |> stub_with(Pleroma.Test.StaticConfig)
+
{:ok, upload} = ActivityPub.upload(file, actor: user.ap_id)
attrs = %{
diff --git a/test/pleroma/web/pleroma_api/views/backup_view_test.exs b/test/pleroma/web/pleroma_api/views/backup_view_test.exs
index 6908463d6..b125b8872 100644
--- a/test/pleroma/web/pleroma_api/views/backup_view_test.exs
+++ b/test/pleroma/web/pleroma_api/views/backup_view_test.exs
@@ -4,10 +4,21 @@
defmodule Pleroma.Web.PleromaAPI.BackupViewTest do
use Pleroma.DataCase, async: true
+
+ alias Pleroma.UnstubbedConfigMock, as: ConfigMock
alias Pleroma.User.Backup
alias Pleroma.Web.PleromaAPI.BackupView
+
+ import Mox
import Pleroma.Factory
+ setup do
+ ConfigMock
+ |> stub_with(Pleroma.Test.StaticConfig)
+
+ :ok
+ end
+
test "it renders the ID" do
user = insert(:user)
backup = Backup.new(user)