Newer
Older
#EventMachine::WebSocket.stub!(:start)
@controller = SocketController.new
end
it 'should unstub the websocket' do
WebSocket.initialize_channel
end
it 'should add a new subscriber to the websocket channel' do
WebSocket.initialize_channel
@controller.new_subscriber.should == 1
end
describe 'actionhash' do
before do
@message = Factory.create(:status_message, :person => @user)
end
it 'should actionhash posts' do
json = @controller.action_hash(@message)
json.include?(@message.message).should be_true
json.include?('status_message').should be_true
it 'should actionhash retractions' do
retraction = Retraction.for @message
json = @controller.action_hash(retraction)
json.include?('retraction').should be_true
json.include?("html\":null").should be_true