Fix: ブーストが1つでもあるとバックアップ時にエラーが出る問題 (#153)
This commit is contained in:
parent
63f0f1bfd0
commit
a87f6f4828
2 changed files with 12 additions and 2 deletions
|
@ -11,6 +11,7 @@ RSpec.describe BackupService, type: :service do
|
|||
let!(:private_status) { Fabricate(:status, account: user.account, text: 'secret', visibility: :private) }
|
||||
let!(:favourite) { Fabricate(:favourite, account: user.account) }
|
||||
let!(:bookmark) { Fabricate(:bookmark, account: user.account) }
|
||||
let!(:reblog) { Fabricate(:status, account: user.account, reblog_of_id: Fabricate(:status).id) }
|
||||
let!(:backup) { Fabricate(:backup, user: user) }
|
||||
|
||||
def read_zip_file(backup, filename)
|
||||
|
@ -60,10 +61,11 @@ RSpec.describe BackupService, type: :service do
|
|||
aggregate_failures do
|
||||
expect(json['@context']).to_not be_nil
|
||||
expect(json['type']).to eq 'OrderedCollection'
|
||||
expect(json['totalItems']).to eq 2
|
||||
expect(json['totalItems']).to eq 3
|
||||
expect(json['orderedItems'][0]['@context']).to be_nil
|
||||
expect(json['orderedItems'][0]).to include_create_item(status)
|
||||
expect(json['orderedItems'][1]).to include_create_item(private_status)
|
||||
expect(json['orderedItems'][2]).to include_announce_item(reblog)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -98,4 +100,11 @@ RSpec.describe BackupService, type: :service do
|
|||
}),
|
||||
})
|
||||
end
|
||||
|
||||
def include_announce_item(status)
|
||||
include({
|
||||
'type' => 'Announce',
|
||||
'object' => ActivityPub::TagManager.instance.uri_for(status.reblog),
|
||||
})
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue