mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Ensure application/json on library flows reqs
This commit is contained in:
@@ -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) {
|
||||
|
@@ -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() {
|
||||
|
Reference in New Issue
Block a user