spec/channel_spec.rb in pubsubstub-0.0.9 vs spec/channel_spec.rb in pubsubstub-0.0.10
- old
+ new
@@ -78,6 +78,16 @@
it "sends the events to the clients" do
expect(connection).to receive(:<<).with(event.to_message)
subject.send(:broadcast, event.to_json)
end
end
+
+ context "#scrollback" do
+ it "sends events to the connection buffer" do
+ event = Pubsubstub::Event.new("message")
+ expect(pubsub).to receive(:scrollback).and_yield(event)
+ connection = ""
+ subject.scrollback(connection, 1)
+ expect(connection).to eq(event.to_message)
+ end
+ end
end