browser-meshblu-http
Version:
Meshblu Client for the Browser
36 lines (27 loc) • 1.09 kB
text/coffeescript
shmock = require '@octoblu/shmock'
MeshbluHttp = require '../'
describe 'Delete Subscriptions', ->
beforeEach ->
= shmock 0xd00d
afterEach (done) ->
.close => done()
describe 'when constructed with valid meshbluConfig', ->
beforeEach ->
meshbluConfig =
hostname: 'localhost'
port: 0xd00d
uuid: 'some-uuid'
token: 'some-token'
= new MeshbluHttp meshbluConfig
describe 'when the device has devices', ->
beforeEach (done) ->
auth = new Buffer('some-uuid:some-token').toString('base64')
=
.delete '/v2/devices/hello-uuid/subscriptions/howdy-uuid/broadcast'
.set 'Authorization', "Basic #{auth}"
.reply 204
.deleteSubscription {subscriberUuid: 'hello-uuid', emitterUuid: 'howdy-uuid', type: 'broadcast'}, (error, ) => done error
it 'should call delete subscription', ->
.done()
it 'should yield an empty response', ->
expect().to.not.exist