Merge remote-tracking branch 'parent/main' into upstream-20241216
This commit is contained in:
commit
3784ad273c
555 changed files with 7564 additions and 3363 deletions
|
@ -38,7 +38,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService do
|
|||
let(:media_attachments) { [] }
|
||||
|
||||
before do
|
||||
mentions.each { |a| Fabricate(:mention, status: status, account: a) }
|
||||
mentions.each { |(account, silent)| Fabricate(:mention, status: status, account: account, silent: silent) }
|
||||
tags.each { |t| status.tags << t }
|
||||
media_attachments.each { |m| status.media_attachments << m }
|
||||
stub_request(:get, bogus_mention).to_raise(HTTP::ConnectionError)
|
||||
|
@ -324,7 +324,19 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService do
|
|||
end
|
||||
|
||||
context 'when originally with mentions' do
|
||||
let(:mentions) { [alice, bob] }
|
||||
let(:mentions) { [[alice, false], [bob, false]] }
|
||||
|
||||
before do
|
||||
subject.call(status, json, json)
|
||||
end
|
||||
|
||||
it 'updates mentions' do
|
||||
expect(status.active_mentions.reload.map(&:account_id)).to eq [alice.id]
|
||||
end
|
||||
end
|
||||
|
||||
context 'when originally with silent mentions' do
|
||||
let(:mentions) { [[alice, true], [bob, true]] }
|
||||
|
||||
before do
|
||||
subject.call(status, json, json)
|
||||
|
|
|
@ -109,7 +109,7 @@ RSpec.describe ReblogService do
|
|||
Status
|
||||
.where(id: reblog_of_id)
|
||||
.where(text: 'discard-status-text')
|
||||
.update_all(deleted_at: Time.now.utc)
|
||||
.touch_all(:deleted_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -199,6 +199,14 @@ RSpec.describe UpdateStatusService do
|
|||
.to eq [bob.id]
|
||||
expect(status.mentions.pluck(:account_id))
|
||||
.to contain_exactly(alice.id, bob.id)
|
||||
|
||||
# Going back when a mention was switched to silence should still be possible
|
||||
subject.call(status, status.account_id, text: 'Hello @alice')
|
||||
|
||||
expect(status.active_mentions.pluck(:account_id))
|
||||
.to eq [alice.id]
|
||||
expect(status.mentions.pluck(:account_id))
|
||||
.to contain_exactly(alice.id, bob.id)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue