discourse/spec/javascripts/message_bus_spec.js.coffee

25 lines
799 B
CoffeeScript
Raw Normal View History

2013-02-05 14:16:51 -05:00
describe "Discourse.MessageBus", ->
describe "Web Sockets", ->
bus = Discourse.MessageBus
bus.start()
# PENDING: Fix to allow these to run in jasmine-guard
#it "is able to get a response from the echo server", ->
# response = null
# bus.send("/echo", "hello world", (r) -> response = r)
# # give it some time to spin up
# waitsFor((-> response == "hello world"),"gotEcho",500)
#it "should get responses from broadcast channel", ->
# response = null
# # note /message_bus/broadcast is dev only
# bus.subscribe("/animals", (r) -> response = r)
# $.ajax
# url: '/message-bus/broadcast'
# data: {channel: "/animals", data: "kitten"}
# cache: false
# waitsFor((-> response == "kitten"),"gotBroadcast", 500)