Skip to content

Commit cd1b36b

Browse files
author
Parth Shah
committed
Merge branch 'hotfix/test-fix'
2 parents 42c359c + 3d0bfcc commit cd1b36b

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

src/routes/attachments/create.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ module.exports = [
120120
response = _.omit(response, ['filePath', 'deletedAt'])
121121

122122
response.downloadUrl = resp.data.result.content.preSignedURL
123-
res.status(201).json(util.wrapResponse(req.id, response))
123+
res.status(201).json(util.wrapResponse(req.id, response, 1, 201))
124124
})
125125
.catch(function(err) {
126126
req.log.error("Error adding attachment", err)

src/routes/projectMembers/create.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module.exports = [
6868
payload: newMember,
6969
props: { correlationId: req.id }
7070
})
71-
res.status(201).json(util.wrapResponse(req.id, newMember))
71+
res.status(201).json(util.wrapResponse(req.id, newMember, 1, 201))
7272
})
7373
.catch((err) => {
7474
req.log.error('Unable to register ', err)

src/routes/projects/create.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ module.exports = [
134134
payload: newProject,
135135
props: { correlationId: req.id }
136136
})
137-
res.status(201).json(util.wrapResponse(req.id, newProject))
137+
res.status(201).json(util.wrapResponse(req.id, newProject, 1, 201))
138138
})
139139
.catch((err) => {
140140
util.handleError('Error creating project', err, req, next)

src/routes/projects/create.spec.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('Project create', () => {
6464
.expect(422,done)
6565
})
6666

67-
it('should return 500 if error to create direct project', done => {
67+
it('should return 201 if error to create direct project', done => {
6868
var mockHttpClient = _.merge(testUtil.mockHttpClient, {
6969
post: () => Promise.reject(new Error('error message'))
7070
})
@@ -74,15 +74,14 @@ describe('Project create', () => {
7474
.set({"Authorization": "Bearer " + testUtil.jwts.member})
7575
.send(body)
7676
.expect('Content-Type', /json/)
77-
.expect(500)
77+
.expect(201)
7878
.end(function (err,res) {
7979
if (err) {
8080
return done(err)
8181
}
8282
const result = res.body.result
83-
result.success.should.be.false
84-
result.status.should.equal(500)
85-
result.content.message.should.equal('Error creating project')
83+
result.success.should.be.truthy
84+
result.status.should.equal(201)
8685
done()
8786
})
8887
})

0 commit comments

Comments
 (0)