alias Pleroma.{Repo, User}
alias Pleroma.Activity
+ setup_all do
+ Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
+ :ok
+ end
+
describe "/relay" do
test "with the relay active, it returns the relay user", %{conn: conn} do
res =
end
test "with the relay disabled, it returns 404", %{conn: conn} do
- instance =
- Application.get_env(:pleroma, :instance)
- |> Keyword.put(:allow_relay, false)
-
- Application.put_env(:pleroma, :instance, instance)
+ Pleroma.Config.put([:instance, :allow_relay], false)
res =
conn
|> get(activity_pub_path(conn, :relay))
|> json_response(404)
- instance =
- Application.get_env(:pleroma, :instance)
- |> Keyword.put(:allow_relay, true)
-
- Application.put_env(:pleroma, :instance, instance)
+ Pleroma.Config.put([:instance, :allow_relay], true)
end
end