MascotControllerTest: Fix tests

This commit is contained in:
Lain Soykaf 2023-12-11 10:49:22 +04:00
parent f5a2337b37
commit 82beb4987a
1 changed files with 9 additions and 0 deletions

View File

@ -5,8 +5,11 @@
defmodule Pleroma.Web.PleromaAPI.MascotControllerTest do defmodule Pleroma.Web.PleromaAPI.MascotControllerTest do
use Pleroma.Web.ConnCase, async: true use Pleroma.Web.ConnCase, async: true
alias Pleroma.UnstubbedConfigMock, as: ConfigMock
alias Pleroma.User alias Pleroma.User
import Mox
test "mascot upload" do test "mascot upload" do
%{conn: conn} = oauth_access(["write:accounts"]) %{conn: conn} = oauth_access(["write:accounts"])
@ -29,6 +32,9 @@ test "mascot upload" do
filename: "an_image.jpg" filename: "an_image.jpg"
} }
ConfigMock
|> stub_with(Pleroma.Test.StaticConfig)
conn = conn =
conn conn
|> put_req_header("content-type", "multipart/form-data") |> put_req_header("content-type", "multipart/form-data")
@ -53,6 +59,9 @@ test "mascot retrieving" do
filename: "an_image.jpg" filename: "an_image.jpg"
} }
ConfigMock
|> stub_with(Pleroma.Test.StaticConfig)
ret_conn = ret_conn =
conn conn
|> put_req_header("content-type", "multipart/form-data") |> put_req_header("content-type", "multipart/form-data")