Q: Rails Rspec test that a controller has triggered Websockets event In my controller I have the following code that triggers a websockets event inside the update method:
WebsocketRails[recipient.id].trigger "new_activity", "Shared" if recipient.online?

How can I test that my controller is triggering this event?

A: expect(triggerable = double).to receive(:trigger)
  .with('new_activity', 'Shared')
allow(WebsocketRails).to receive(:[]).and_return(triggerable)
get :myroute

