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.
crispy-train/test/unit/base/Controller_test.js

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();
});
});
});
});