0
0
Fork 0

Undo notification permissions on individual and domain blocks (#29570)

This commit is contained in:
Claire 2024-03-26 15:46:38 +01:00 committed by GitHub
parent 7508472d84
commit 9c24f2d6b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 18 additions and 12 deletions

View file

@ -11,11 +11,13 @@ RSpec.describe BlockService do
let(:bob) { Fabricate(:account, username: 'bob') }
before do
subject.call(sender, bob)
NotificationPermission.create!(account: sender, from_account: bob)
end
it 'creates a blocking relation' do
expect(sender.blocking?(bob)).to be true
it 'creates a blocking relation and removes notification permissions' do
expect { subject.call(sender, bob) }
.to change { sender.blocking?(bob) }.from(false).to(true)
.and change { NotificationPermission.exists?(account: sender, from_account: bob) }.from(true).to(false)
end
end