aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test/javascript/src/unit/consumer_test.coffee
blob: 41445274eba8631d2123e4e0c1c9aed0b9dd117e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{module, test} = QUnit
{consumerTest} = ActionCable.TestHelpers

module "ActionCable.Consumer", ->
  consumerTest "#connect", connect: false, ({consumer, server, assert, done}) ->
    server.on "connection", ->
      assert.equal consumer.connect(), false
      done()

    consumer.connect()

  consumerTest "#disconnect", ({consumer, client, done}) ->
    client.addEventListener("close", done)
    consumer.disconnect()