mirror of
https://gitlab.silvrtree.co.uk/martind2000/SODashServer.git
synced 2025-01-11 07:45:08 +00:00
25 lines
726 B
JavaScript
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();
|
||
|
});
|
||
|
});
|
||
|
});
|