BackupViewTest: Fix Tests
This commit is contained in:
parent
82beb4987a
commit
dec524e7da
@ -4,12 +4,16 @@
|
|||||||
|
|
||||||
defmodule Pleroma.Web.MastodonAPI.ScheduledActivityViewTest do
|
defmodule Pleroma.Web.MastodonAPI.ScheduledActivityViewTest do
|
||||||
use Pleroma.DataCase, async: true
|
use Pleroma.DataCase, async: true
|
||||||
|
|
||||||
alias Pleroma.ScheduledActivity
|
alias Pleroma.ScheduledActivity
|
||||||
|
alias Pleroma.UnstubbedConfigMock, as: ConfigMock
|
||||||
alias Pleroma.Web.ActivityPub.ActivityPub
|
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||||
alias Pleroma.Web.CommonAPI
|
alias Pleroma.Web.CommonAPI
|
||||||
alias Pleroma.Web.CommonAPI.Utils
|
alias Pleroma.Web.CommonAPI.Utils
|
||||||
alias Pleroma.Web.MastodonAPI.ScheduledActivityView
|
alias Pleroma.Web.MastodonAPI.ScheduledActivityView
|
||||||
alias Pleroma.Web.MastodonAPI.StatusView
|
alias Pleroma.Web.MastodonAPI.StatusView
|
||||||
|
|
||||||
|
import Mox
|
||||||
import Pleroma.Factory
|
import Pleroma.Factory
|
||||||
|
|
||||||
test "A scheduled activity with a media attachment" do
|
test "A scheduled activity with a media attachment" do
|
||||||
@ -27,6 +31,9 @@ defmodule Pleroma.Web.MastodonAPI.ScheduledActivityViewTest do
|
|||||||
filename: "an_image.jpg"
|
filename: "an_image.jpg"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ConfigMock
|
||||||
|
|> stub_with(Pleroma.Test.StaticConfig)
|
||||||
|
|
||||||
{:ok, upload} = ActivityPub.upload(file, actor: user.ap_id)
|
{:ok, upload} = ActivityPub.upload(file, actor: user.ap_id)
|
||||||
|
|
||||||
attrs = %{
|
attrs = %{
|
||||||
|
@ -4,10 +4,21 @@
|
|||||||
|
|
||||||
defmodule Pleroma.Web.PleromaAPI.BackupViewTest do
|
defmodule Pleroma.Web.PleromaAPI.BackupViewTest do
|
||||||
use Pleroma.DataCase, async: true
|
use Pleroma.DataCase, async: true
|
||||||
|
|
||||||
|
alias Pleroma.UnstubbedConfigMock, as: ConfigMock
|
||||||
alias Pleroma.User.Backup
|
alias Pleroma.User.Backup
|
||||||
alias Pleroma.Web.PleromaAPI.BackupView
|
alias Pleroma.Web.PleromaAPI.BackupView
|
||||||
|
|
||||||
|
import Mox
|
||||||
import Pleroma.Factory
|
import Pleroma.Factory
|
||||||
|
|
||||||
|
setup do
|
||||||
|
ConfigMock
|
||||||
|
|> stub_with(Pleroma.Test.StaticConfig)
|
||||||
|
|
||||||
|
:ok
|
||||||
|
end
|
||||||
|
|
||||||
test "it renders the ID" do
|
test "it renders the ID" do
|
||||||
user = insert(:user)
|
user = insert(:user)
|
||||||
backup = Backup.new(user)
|
backup = Backup.new(user)
|
||||||
|
Loading…
Reference in New Issue
Block a user