testing lines of code that are not documented...and documenting them - DK/MW

This commit is contained in:
Mathew Woods
2016-10-20 10:22:11 -05:00
committed by Fabian Arndt
parent 7902478c82
commit bdbea069ad
2 changed files with 20 additions and 1 deletions

View File

@ -27,7 +27,7 @@ describe('authorizer', function () {
describe('when the user is logged in', function() {
beforeEach(function (done) {
before(function (done) {
request.post({
url: 'http://localhost:9000/login',
form: { username: 'jose', password: 'Pa123' },
@ -38,6 +38,17 @@ describe('authorizer', function () {
}.bind(this));
});
it('auth headers are supported', function (done){
var socket = io.connect('http://localhost:9000', {
'forceNew':true,
'extraHeaders': {'Authorization': `Bearer ${this.token}`}
});
socket.on('connect', function(){
socket.close();
done();
}).on('error', done);
});
it('should do the handshake and connect', function (done){
var socket = io.connect('http://localhost:9000', {
'forceNew':true,