Merge branch 'main' into glitch-soc/merge-upstream

Conflicts:
- `app/models/status.rb`:
  Upstream updated media and edit-related code textually close to glitch-soc
  additions (local-only and content-type).
  Ported upstream changes.
- `app/models/status_edit.rb`:
  Upstream changes textually close to glitch-soc additions (content-type).
  Ported upstream changes.
- `app/serializers/activitypub/note_serializer.rb`:
  Upstream changed how media attachments are handled. Not really a conflict,
  but textually close to glitch-soc additions (directMessage attribute).
  Ported upstream changes.
- `app/services/remove_status_service.rb`:
  Upstream changed how media attachments are handled. Not really a conflict,
  but textually close to glitch-soc additions (DM timeline).
  Ported upstream changes.
- `app/services/update_status_service.rb`:
  Upstream fixed an issue with language selection. Not really a conflict,
  but textually close to glitch-soc additions (content-type).
  Ported upstream changes.
- `db/schema.rb`:
  Upstream added columns to the `status_edits` table, the conflict is because
  of an additional column (`content-type`) in glitch-soc.
  Ported upstream changes.
- `package.json`:
  Upstream dependency (express) textually adjacent to a glitch-soc-specific one
  (favico.js) got updated.
  Updated it as well.
This commit is contained in:
Claire
2022-03-10 09:52:45 +01:00
168 changed files with 1826 additions and 728 deletions

View File

@ -11,14 +11,13 @@ describe Report do
end
end
describe 'media_attachments' do
it 'returns media attachments from statuses' do
status = Fabricate(:status)
media_attachment = Fabricate(:media_attachment, status: status)
_other_media_attachment = Fabricate(:media_attachment)
report = Fabricate(:report, status_ids: [status.id])
describe 'media_attachments_count' do
it 'returns count of media attachments in statuses' do
status1 = Fabricate(:status, ordered_media_attachment_ids: [1, 2])
status2 = Fabricate(:status, ordered_media_attachment_ids: [5])
report = Fabricate(:report, status_ids: [status1.id, status2.id])
expect(report.media_attachments).to eq [media_attachment]
expect(report.media_attachments_count).to eq 3
end
end