mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 11:32:24 -05:00
27 lines
648 B
Ruby
27 lines
648 B
Ruby
require 'spec_helper'
|
|
require 'message_bus'
|
|
|
|
describe MessageBus::Client do
|
|
|
|
describe "subscriptions" do
|
|
|
|
before do
|
|
@client = MessageBus::Client.new :client_id => 'abc'
|
|
end
|
|
|
|
it "should provide a list of subscriptions" do
|
|
@client.subscribe('/hello', nil)
|
|
@client.subscriptions['/hello'].should_not be_nil
|
|
end
|
|
|
|
it "should provide backlog for subscribed channel" do
|
|
@client.subscribe('/hello', nil)
|
|
MessageBus.publish '/hello', 'world'
|
|
log = @client.backlog
|
|
log.length.should == 1
|
|
log[0].channel.should == '/hello'
|
|
log[0].data.should == 'world'
|
|
end
|
|
end
|
|
|
|
end
|