diff options
author | marcin mikołajczak <git@mkljczk.pl> | 2024-03-07 20:14:05 +0100 |
---|---|---|
committer | marcin mikołajczak <git@mkljczk.pl> | 2024-03-10 23:53:12 +0100 |
commit | bb0b17f4d9a235f79b4b6fabdc5e3dbe472cd259 (patch) | |
tree | 69f602e6395e2aa3526f7a7fb550d1bdc3c84309 /test | |
parent | 8298b326a7a3081be262c73f734dfe3082962e83 (diff) | |
download | pleroma-bb0b17f4d9a235f79b4b6fabdc5e3dbe472cd259.tar.gz pleroma-bb0b17f4d9a235f79b4b6fabdc5e3dbe472cd259.zip |
Include following/followers in backups
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/user/backup_test.exs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/pleroma/user/backup_test.exs b/test/pleroma/user/backup_test.exs index 0ac57e334..5503d15bc 100644 --- a/test/pleroma/user/backup_test.exs +++ b/test/pleroma/user/backup_test.exs @@ -166,6 +166,7 @@ defmodule Pleroma.User.BackupTest do test "it creates a zip archive with user data" do user = insert(:user, %{nickname: "cofe", name: "Cofe", ap_id: "http://cofe.io/users/cofe"}) + %{ap_id: other_ap_id} = other_user = insert(:user) {:ok, %{object: %{data: %{"id" => id1}}} = status1} = CommonAPI.post(user, %{status: "status1"}) @@ -182,6 +183,8 @@ defmodule Pleroma.User.BackupTest do Bookmark.create(user.id, status2.id) Bookmark.create(user.id, status3.id) + CommonAPI.follow(user, other_user) + assert {:ok, backup} = user |> Backup.new() |> Repo.insert() assert {:ok, path} = Backup.export(backup, self()) assert {:ok, zipfile} = :zip.zip_open(String.to_charlist(path), [:memory]) @@ -261,6 +264,16 @@ defmodule Pleroma.User.BackupTest do "type" => "OrderedCollection" } = Jason.decode!(json) + assert {:ok, {'following.json', json}} = :zip.zip_get('following.json', zipfile) + + assert %{ + "@context" => "https://www.w3.org/ns/activitystreams", + "id" => "following.json", + "orderedItems" => [^other_ap_id], + "totalItems" => 1, + "type" => "OrderedCollection" + } = Jason.decode!(json) + :zip.zip_close(zipfile) File.rm!(path) end |