browser-meshblu-http
Version:
Meshblu Client for the Browser
37 lines (29 loc) • 1.07 kB
text/coffeescript
{afterEach, beforeEach, describe, it} = global
shmock = require '@octoblu/shmock'
enableDestroy = require 'server-destroy'
MeshbluHttp = require '../'
describe 'Remove Token by Query', ->
beforeEach ->
= shmock()
enableDestroy
afterEach (done) ->
.destroy done
describe 'when constructed with valid meshbluConfig', ->
beforeEach ->
meshbluConfig =
hostname: 'localhost'
port: .address().port
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 '/devices/hello-uuid/tokens'
.query tag: 'remove-this-tag'
.set 'Authorization', "Basic #{auth}"
.reply 200
.removeTokenByQuery 'hello-uuid', tag: 'remove-this-tag', (error) => done error
it 'should call delete token', ->
.done()