SODashServer/old-tests/server.js
Martin Donnelly d93ebb4466 init
2016-04-13 10:01:28 +01:00

25 lines
726 B
JavaScript

/**
* Created by Martin on 08/02/2016.
*/
var request = require('superagent'), should=require('should');
describe('homepage', function() {
it('should respond to GET', function(done) {
request.get('http://localhost:3000')
.end(function(err,res) {
if (err) {return done(err);}
should(res.status).equal(200);
done();
});
});
it('should not respond to POST', function(done) {
request.post('http://localhost:3000')
.send({name:'Martin'})
.set('Accept','application/json')
.end(function(res) {
should(res.status).equal(404);
done();
});
});
});