From 5df87a751b02ded55a573ddbca7fc3549c478f28 Mon Sep 17 00:00:00 2001 From: maxceem Date: Tue, 9 Jul 2019 13:08:41 +0800 Subject: [PATCH] Revert "Add new tests for project update" --- src/routes/projects/update.spec.js | 87 ------------------------------ 1 file changed, 87 deletions(-) diff --git a/src/routes/projects/update.spec.js b/src/routes/projects/update.spec.js index 8f76cc57..f1cb51ef 100644 --- a/src/routes/projects/update.spec.js +++ b/src/routes/projects/update.spec.js @@ -66,7 +66,6 @@ describe('Project', () => { details: {}, createdBy: 1, updatedBy: 1, - templateId: 1, lastActivityAt: 1, lastActivityUserId: '1', createdAt: '2016-06-30 00:33:07+00', @@ -80,7 +79,6 @@ describe('Project', () => { details: {}, createdBy: 1, updatedBy: 1, - templateId: 1, lastActivityAt: 1, lastActivityUserId: '1', createdAt: '2016-06-30 00:33:07+00', @@ -93,7 +91,6 @@ describe('Project', () => { details: {}, createdBy: 1, updatedBy: 1, - templateId: 1, lastActivityAt: 1, lastActivityUserId: '1', createdAt: '2016-06-30 00:33:07+00', @@ -122,12 +119,6 @@ describe('Project', () => { userId: 40051332, createdBy: 1, updatedBy: 1, - }, { - projectId: project1.id, - role: 'member', - userId: 40051331, - createdBy: 1, - updatedBy: 1, }]); }).then(() => done()); }); @@ -188,84 +179,6 @@ describe('Project', () => { }); }); - it('should not update the templateId for admin', (done) => { - request(server) - .patch(`/v4/projects/${project1.id}`) - .set({ - Authorization: `Bearer ${testUtil.jwts.admin}`, - }) - .send({ - param: { - templateId: 2, - }, - }) - .expect('Content-Type', /json/) - .expect(200) - .end((err, res) => { - if (err) { - done(err); - } else { - const result = res.body.result; - result.success.should.be.true; - result.status.should.equal(200); - result.content.templateId.should.equal(project1.templateId); - done(); - } - }); - }); - - it('should not update the templateId for manager', (done) => { - request(server) - .patch(`/v4/projects/${project1.id}`) - .set({ - Authorization: `Bearer ${testUtil.jwts.manager}`, - }) - .send({ - param: { - templateId: 2, - }, - }) - .expect('Content-Type', /json/) - .expect(200) - .end((err, res) => { - if (err) { - done(err); - } else { - const result = res.body.result; - result.success.should.be.true; - result.status.should.equal(200); - result.content.templateId.should.equal(project1.templateId); - done(); - } - }); - }); - - it('should not update the templateId for user', (done) => { - request(server) - .patch(`/v4/projects/${project1.id}`) - .set({ - Authorization: `Bearer ${testUtil.jwts.member}`, - }) - .send({ - param: { - templateId: 2, - }, - }) - .expect('Content-Type', /json/) - .expect(200) - .end((err, res) => { - if (err) { - done(err); - } else { - const result = res.body.result; - result.success.should.be.true; - result.status.should.equal(200); - result.content.templateId.should.equal(project1.templateId); - done(); - } - }); - }); - it('should return 200 if topcoder manager user will update a project', (done) => { request(server) .patch(`/v4/projects/${project1.id}`)