mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:01:18 +08:00
Nuke message_bus_observer move to service class and classes
Secure all messages triggered by post creation and all user actions so they don't leak (meaning, if you have a browser open and secure topics are created you will only get them if you are allowed to see them)
This commit is contained in:
@ -90,7 +90,7 @@ describe Notification do
|
||||
describe 'message bus' do
|
||||
|
||||
it 'updates the notification count on create' do
|
||||
MessageBusObserver.any_instance.expects(:refresh_notification_count).with(instance_of(Notification))
|
||||
Notification.any_instance.expects(:refresh_notification_count).returns(nil)
|
||||
Fabricate(:notification)
|
||||
end
|
||||
|
||||
@ -99,7 +99,7 @@ describe Notification do
|
||||
let!(:notification) { Fabricate(:notification) }
|
||||
|
||||
it 'updates the notification count on destroy' do
|
||||
MessageBusObserver.any_instance.expects(:refresh_notification_count).with(instance_of(Notification))
|
||||
Notification.any_instance.expects(:refresh_notification_count).returns(nil)
|
||||
notification.destroy
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user