X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fweb%2Fpleroma_api%2Fcontrollers%2Fbackup_controller_test.exs;h=ba17636daf0905477b82f1fd4233708764fa577a;hb=f08241c8ab1b1f920e6c2d179fc1086b0ad10c1d;hp=b2ac74c7dc0ae6b903908f295ac52f1d36663930;hpb=c1976d5b19fbceaecf1f52711fe35e1c7d5312aa;p=akkoma
diff --git a/test/pleroma/web/pleroma_api/controllers/backup_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/backup_controller_test.exs
index b2ac74c7d..ba17636da 100644
--- a/test/pleroma/web/pleroma_api/controllers/backup_controller_test.exs
+++ b/test/pleroma/web/pleroma_api/controllers/backup_controller_test.exs
@@ -1,11 +1,11 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.PleromaAPI.BackupControllerTest do
use Pleroma.Web.ConnCase
- alias Pleroma.Backup
+ alias Pleroma.User.Backup
alias Pleroma.Web.PleromaAPI.BackupView
setup do
@@ -82,4 +82,24 @@ defmodule Pleroma.Web.PleromaAPI.BackupControllerTest do
|> post("/api/v1/pleroma/backups")
|> json_response_and_validate_schema(400)
end
+
+ test "Backup without email address" do
+ user = Pleroma.Factory.insert(:user, email: nil)
+ %{conn: conn} = oauth_access(["read:accounts"], user: user)
+
+ assert is_nil(user.email)
+
+ assert [
+ %{
+ "content_type" => "application/zip",
+ "url" => _url,
+ "file_size" => 0,
+ "processed" => false,
+ "inserted_at" => _
+ }
+ ] =
+ conn
+ |> post("/api/v1/pleroma/backups")
+ |> json_response_and_validate_schema(:ok)
+ end
end