|
|
@@ -11,7 +11,6 @@ describe('HttpController', function () {
|
|
|
'./HistoryManager': (this.HistoryManager = {
|
|
|
flushProjectChangesAsync: sinon.stub(),
|
|
|
}),
|
|
|
- './ProjectHistoryRedisManager': (this.ProjectHistoryRedisManager = {}),
|
|
|
'./ProjectManager': (this.ProjectManager = {}),
|
|
|
'./ProjectFlusher': { flushAllProjects() {} },
|
|
|
'./DeleteQueueManager': (this.DeleteQueueManager = {}),
|
|
|
@@ -652,7 +651,6 @@ describe('HttpController', function () {
|
|
|
|
|
|
describe('deleteComment', function () {
|
|
|
beforeEach(function () {
|
|
|
- this.user_id = 'user-id-123'
|
|
|
this.req = {
|
|
|
params: {
|
|
|
project_id: this.project_id,
|
|
|
@@ -660,9 +658,7 @@ describe('HttpController', function () {
|
|
|
comment_id: (this.comment_id = 'mock-comment-id'),
|
|
|
},
|
|
|
query: {},
|
|
|
- body: {
|
|
|
- user_id: this.user_id,
|
|
|
- },
|
|
|
+ body: {},
|
|
|
}
|
|
|
})
|
|
|
|
|
|
@@ -670,20 +666,13 @@ describe('HttpController', function () {
|
|
|
beforeEach(function () {
|
|
|
this.DocumentManager.deleteCommentWithLock = sinon
|
|
|
.stub()
|
|
|
- .callsArgWith(4)
|
|
|
-
|
|
|
- this.ProjectHistoryRedisManager.queueOps = sinon.stub()
|
|
|
+ .callsArgWith(3)
|
|
|
this.HttpController.deleteComment(this.req, this.res, this.next)
|
|
|
})
|
|
|
|
|
|
it('should accept the change', function () {
|
|
|
this.DocumentManager.deleteCommentWithLock
|
|
|
- .calledWith(
|
|
|
- this.project_id,
|
|
|
- this.doc_id,
|
|
|
- this.comment_id,
|
|
|
- this.user_id
|
|
|
- )
|
|
|
+ .calledWith(this.project_id, this.doc_id, this.comment_id)
|
|
|
.should.equal(true)
|
|
|
})
|
|
|
|
|
|
@@ -713,7 +702,7 @@ describe('HttpController', function () {
|
|
|
beforeEach(function () {
|
|
|
this.DocumentManager.deleteCommentWithLock = sinon
|
|
|
.stub()
|
|
|
- .callsArgWith(4, new Error('oops'))
|
|
|
+ .callsArgWith(3, new Error('oops'))
|
|
|
this.HttpController.deleteComment(this.req, this.res, this.next)
|
|
|
})
|
|
|
|