nebulab-dropbox
Version:
Client library for the Dropbox API
115 lines (103 loc) • 4.09 kB
text/coffeescript
describe 'Dropbox.ApiError', ->
describe '.NETWORK_ERROR', ->
beforeEach ->
= Dropbox.ApiError.NETWORK_ERROR
it 'is defined', ->
expect(Dropbox.ApiError).to.have.property 'NETWORK_ERROR'
it 'is between 0 and 99', ->
expect().to.be.within 0, 99
it 'is falsey', ->
expect().to.not.be.ok
describe '.NO_CONTENT', ->
beforeEach ->
= Dropbox.ApiError.NO_CONTENT
it 'is defined', ->
expect(Dropbox.ApiError).to.have.property 'NO_CONTENT'
it 'is between 300 and 399', ->
expect().to.be.within 300, 399
describe '.INVALID_PARAM', ->
beforeEach ->
= Dropbox.ApiError.INVALID_PARAM
it 'is defined', ->
expect(Dropbox.ApiError).to.have.property 'INVALID_PARAM'
it 'is between 400 and 499', ->
expect().to.be.within 400, 499
it 'is less than INVALID_TOKEN', ->
expect().to.be.below Dropbox.ApiError.INVALID_TOKEN
describe '.INVALID_TOKEN', ->
beforeEach ->
= Dropbox.ApiError.INVALID_TOKEN
it 'is defined', ->
expect(Dropbox.ApiError).to.have.property 'INVALID_TOKEN'
it 'is between 400 and 499', ->
expect().to.be.within 400, 499
it 'is less than OAUTH_ERROR', ->
expect().to.be.below Dropbox.ApiError.OAUTH_ERROR
describe '.OAUTH_ERROR', ->
beforeEach ->
= Dropbox.ApiError.OAUTH_ERROR
it 'is defined', ->
expect(Dropbox.ApiError).to.have.property 'OAUTH_ERROR'
it 'is between 400 and 499', ->
expect().to.be.within 400, 499
it 'is less than NOT_FOUND', ->
expect().to.be.below Dropbox.ApiError.NOT_FOUND
describe '.NOT_FOUND', ->
beforeEach ->
= Dropbox.ApiError.NOT_FOUND
it 'is defined', ->
expect(Dropbox.ApiError).to.have.property 'NOT_FOUND'
it 'is between 400 and 499', ->
expect().to.be.within 400, 499
it 'is less than INVALID_METHOD', ->
expect().to.be.below Dropbox.ApiError.INVALID_METHOD
describe '.INVALID_METHOD', ->
beforeEach ->
= Dropbox.ApiError.INVALID_METHOD
it 'is defined', ->
expect(Dropbox.ApiError).to.have.property 'INVALID_METHOD'
it 'is between 400 and 499', ->
expect().to.be.within 400, 499
it 'is less than NOT_ACCEPTABLE', ->
expect().to.be.below Dropbox.ApiError.NOT_ACCEPTABLE
describe '.NOT_ACCEPTABLE', ->
beforeEach ->
= Dropbox.ApiError.NOT_ACCEPTABLE
it 'is defined', ->
expect(Dropbox.ApiError).to.have.property 'NOT_ACCEPTABLE'
it 'is between 400 and 499', ->
expect().to.be.within 400, 499
it 'is less than CONFLICT', ->
expect().to.be.below Dropbox.ApiError.CONFLICT
describe '.CONFLICT', ->
beforeEach ->
= Dropbox.ApiError.CONFLICT
it 'is defined', ->
expect(Dropbox.ApiError).to.have.property 'CONFLICT'
it 'is between 400 and 499', ->
expect().to.be.within 400, 499
it 'is less than RATE_LIMITED', ->
expect().to.be.below Dropbox.ApiError.RATE_LIMITED
describe '.RATE_LIMITED', ->
beforeEach ->
= Dropbox.ApiError.RATE_LIMITED
it 'is defined', ->
expect(Dropbox.ApiError).to.have.property 'RATE_LIMITED'
it 'is between 400 and 499', ->
expect().to.be.within 400, 499
describe '.SERVER_ERROR', ->
beforeEach ->
= Dropbox.ApiError.SERVER_ERROR
it 'is defined', ->
expect(Dropbox.ApiError).to.have.property 'SERVER_ERROR'
it 'is between 500 and 599', ->
expect().to.be.within 500, 599
it 'is less than OVER_QUOTA', ->
expect().to.be.below Dropbox.ApiError.OVER_QUOTA
describe '.OVER_QUOTA', ->
beforeEach ->
= Dropbox.ApiError.OVER_QUOTA
it 'is defined', ->
expect(Dropbox.ApiError).to.have.property 'OVER_QUOTA'
it 'is between 500 and 599', ->
expect().to.be.within 500, 599