Merge commit from fork

* Streaming: Ensure disabled users cannot connect to streaming

* Streaming: Disconnect when the user is disabled

---------

Co-authored-by: Emelia Smith <ThisIsMissEm@users.noreply.github.com>
This commit is contained in:
Claire 2025-10-13 14:19:14 +02:00 committed by GitHub
parent 5226b757fe
commit 4bd193cdfe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 5 deletions

View file

@ -448,12 +448,15 @@ RSpec.describe User do
let(:current_sign_in_at) { Time.zone.now }
before do
user.disable!
end
it 'disables user' do
allow(redis).to receive(:publish)
user.disable!
expect(user).to have_attributes(disabled: true)
expect(redis)
.to have_received(:publish).with("timeline:system:#{user.account.id}", Oj.dump(event: :kill)).once
end
end