Skip to content

Commit

Permalink
test tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonSharratt committed Feb 5, 2020
1 parent 1350981 commit 870a9d2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions microservices/requestApi/test/v2/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ chai.use(chaiHttp);

describe("Requests", function() {
var activeRequestId = '';
var firstId = '';
var incorrectId = '';
var fileId = 'test_' + Math.random().toString(36) + '.jpeg';
var activeFormId = '';
after(function(done){
db.Request.deleteMany({}, function(err){
var minio = require('minio');
Expand Down Expand Up @@ -856,9 +856,9 @@ describe("Forms", function() {
}]
})
.end(function (err, res) {
console.log("SHOULD CREATE A FORM", res.status, res.body);
res.should.have.status(200);
res.body.should.have.property('_id');
activeFormId = res.body._id;
done();
});
});
Expand All @@ -882,6 +882,7 @@ describe("Forms", function() {
.put('/v2/forms/testform')
.set("Authorization", "Bearer "+adminJwt)
.send({
"_id": activeFormId,
"title": "testform2",
})
.end(function (err, res) {
Expand All @@ -895,7 +896,9 @@ describe("Forms", function() {
chai.request(server)
.delete('/v2/forms/testform')
.set("Authorization", "Bearer "+jwt)
.send({})
.send({
"_id": activeFormId,
})
.end(function (err, res) {
res.should.have.status(403);
res.body.should.have.property('error');
Expand All @@ -907,7 +910,9 @@ describe("Forms", function() {
chai.request(server)
.delete('/v2/forms/testform')
.set("Authorization", "Bearer "+adminJwt)
.send({})
.send({
"_id": activeFormId,
})
.end(function (err, res) {
res.should.have.status(200);
res.body.should.have.property('_id');
Expand Down

0 comments on commit 870a9d2

Please sign in to comment.