Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonSharratt committed Feb 3, 2020
1 parent 882e05b commit f315564
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion microservices/requestApi/db/model/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@ model.getAll = function(query, limit, page, user, callback){

if ('_id' in query) {
db.Request.findById(query['_id'], (err3, req) => {
console.log("_ID", typeof(req), req);
if ( (req !== null) && (typeof(req) !== "undefined") && (typeof(req.topic) !== "undefined") ){
getAllTopics(user, { id: req.topic }, queryRequests);
}else{
Expand Down
2 changes: 2 additions & 0 deletions microservices/requestApi/routes/routes/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ var buildDynamic = function(projectConfig, db, notify, util, router){
var logger = require('npmlog');
var requestId = mongoose.Types.ObjectId(req.params.requestId);

console.log("Submitting", req.params.requestId, requestId);

// Lookup project from user groups
var project = projectConfig.deriveProjectFromUser(req.user);

Expand Down
3 changes: 2 additions & 1 deletion microservices/requestApi/test/v1/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,10 @@ describe("Requests", function() {
.set("Authorization", "Bearer " + jwt)
.send({})
.end(function (err, res) {
console.log("it should fail to save a request", incorrectId, res.body);
res.should.have.status(400);
res.body.should.be.a('object');
res.body.should.have.property('error');
done();
});
});

Expand Down Expand Up @@ -393,6 +393,7 @@ describe("Requests", function() {
res.should.have.status(400);
res.body.should.be.a('object');
res.body.should.have.property('error');
done();
});
});
});
Expand Down

0 comments on commit f315564

Please sign in to comment.