This repository has been archived on 2018-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ProgBlog/test/unit/base/Controller_test.js
2016-02-19 12:58:16 -05:00

28 lines
636 B
JavaScript

'use strict';
const testBase = require('../../test-base');
const errors = require('errors');
const expect = testBase.expect;
suite('Controller tests', () => {
let controller = null;
setup(() => {
controller = testBase.requireNoCache('app/base/Controller');
});
suite('HttpError Tests', () => {
test('500 Error', (done) => {
controller.HttpError(500, (err) => {
expect(err).to.deep.equal(new errors.Http500Error());
return done();
});
});
test('401 Error', (done) => {
controller.HttpError(401, (err) => {
expect(err).to.deep.equal(new errors.Http401Error());
return done();
});
});
});
});