You can use
capture_broadcasts
with rspec and get it down to: expect(messages).to eq ['first', 'second', 'third']