Ghost/core/test/unit/server_spec.js
Hannah Wolfe c301510cd1 Refactor gravatarLookup, remove request dependency
no issue

- request is quite a heavy dependency
- we were only using request in 3 places: a test, storing contrib images in the gruntfile & the gravatar lookup
- all 3 are relatively simple to do with the http/https module
- refactored all 3, removed request
2016-02-16 11:12:01 +00:00

23 lines
700 B
JavaScript

/*globals describe, it*/
/*jshint expr:true*/
var should = require('should'),
http = require('http'),
config = require('../../../config');
describe('Server', function () {
var port = config.testing.server.port,
host = config.testing.server.host,
url = 'http://' + host + ':' + port;
it('should not start a connect server when required', function (done) {
http.get(url, function () {
done('This request should not have worked');
}).on('error', function (error) {
should(error).not.equal(undefined);
should(error.code).equal('ECONNREFUSED');
done();
});
});
});