Ensure application/json on library flows reqs

This commit is contained in:
Nick O'Leary
2014-11-05 22:41:05 +00:00
parent e7eb02fcb7
commit a520240b25
5 changed files with 47 additions and 31 deletions

View File

@@ -103,7 +103,7 @@ describe("library api", function() {
var flow = '[]';
request(app)
.post('/library/flows/foo')
.set('Content-Type', 'text/plain')
.set('Content-Type', 'application/json')
.send(flow)
.expect(204).end(function (err, res) {
if (err) {

View File

@@ -150,6 +150,23 @@ describe("nodes api", function() {
});
});
it('returns 400 if request is invalid', function(done) {
var settingsAvailable = sinon.stub(settings,'available', function() {
return true;
});
request(app)
.post('/nodes')
.send({})
.expect(400)
.end(function(err,res) {
settingsAvailable.restore();
if (err) {
throw err;
}
done();
});
});
describe('by module', function() {
it('installs the module and returns node info', function(done) {
var settingsAvailable = sinon.stub(settings,'available', function() {