Fix notifications from limited users being outright dropped (#30559)
This commit is contained in:
parent
a5a1584675
commit
bf56e982a9
3 changed files with 33 additions and 7 deletions
|
@ -129,6 +129,35 @@ RSpec.describe NotifyService do
|
|||
end
|
||||
end
|
||||
|
||||
describe NotifyService::DismissCondition do
|
||||
subject { described_class.new(notification) }
|
||||
|
||||
let(:activity) { Fabricate(:mention, status: Fabricate(:status)) }
|
||||
let(:notification) { Fabricate(:notification, type: :mention, activity: activity, from_account: activity.status.account, account: activity.account) }
|
||||
|
||||
describe '#dismiss?' do
|
||||
context 'when sender is silenced' do
|
||||
before do
|
||||
notification.from_account.silence!
|
||||
end
|
||||
|
||||
it 'returns false' do
|
||||
expect(subject.dismiss?).to be false
|
||||
end
|
||||
end
|
||||
|
||||
context 'when recipient has blocked sender' do
|
||||
before do
|
||||
notification.account.block!(notification.from_account)
|
||||
end
|
||||
|
||||
it 'returns true' do
|
||||
expect(subject.dismiss?).to be true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe NotifyService::FilterCondition do
|
||||
subject { described_class.new(notification) }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue