Ghost/core/test/unit/server_spec.js
Hannah Wolfe 2dd1f4a635 Test bug fix
- test should use testing config, not development config. If you run the tests whilst also running the dev server, the tests fail.
2013-11-28 12:33:02 +00:00

30 lines
914 B
JavaScript

/*globals describe, beforeEach, it*/
var net = require('net'),
assert = require('assert'),
should = require('should'),
request = require('request'),
server = require('../../server'),
Ghost = require('../../ghost'),
config = require('../../../config'),
ghost = new Ghost();
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) {
request(url, function (error, response, body) {
assert.equal(response, undefined);
assert.equal(body, undefined);
assert.notEqual(error, undefined);
assert.equal(error.code, 'ECONNREFUSED');
done();
});
});
});