|
@@ -153,9 +153,16 @@ describe('DocumentController', function() {
|
|
|
beforeEach(function() {
|
|
beforeEach(function() {
|
|
|
this.doc = { _id: this.doc_id }
|
|
this.doc = { _id: this.doc_id }
|
|
|
this.projectHistoryId = 1234
|
|
this.projectHistoryId = 1234
|
|
|
|
|
+ this.projectHistoryDisplay = true
|
|
|
|
|
+ this.projectHistoryType = 'project-history'
|
|
|
this.project = {
|
|
this.project = {
|
|
|
_id: this.project_id,
|
|
_id: this.project_id,
|
|
|
- overleaf: { history: { id: this.projectHistoryId } }
|
|
|
|
|
|
|
+ overleaf: {
|
|
|
|
|
+ history: {
|
|
|
|
|
+ id: this.projectHistoryId,
|
|
|
|
|
+ display: this.projectHistoryDisplay
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
this.ProjectGetter.getProject = sinon
|
|
this.ProjectGetter.getProject = sinon
|
|
|
.stub()
|
|
.stub()
|
|
@@ -180,7 +187,7 @@ describe('DocumentController', function() {
|
|
|
)
|
|
)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- it('should return the history id to the client as JSON', function() {
|
|
|
|
|
|
|
+ it('should return the history id and display setting to the client as JSON', function() {
|
|
|
this.res.type.should.equal('application/json')
|
|
this.res.type.should.equal('application/json')
|
|
|
return this.res.body.should.equal(
|
|
return this.res.body.should.equal(
|
|
|
JSON.stringify({
|
|
JSON.stringify({
|
|
@@ -188,7 +195,8 @@ describe('DocumentController', function() {
|
|
|
version: this.version,
|
|
version: this.version,
|
|
|
ranges: this.ranges,
|
|
ranges: this.ranges,
|
|
|
pathname: this.pathname,
|
|
pathname: this.pathname,
|
|
|
- projectHistoryId: this.projectHistoryId
|
|
|
|
|
|
|
+ projectHistoryId: this.projectHistoryId,
|
|
|
|
|
+ projectHistoryType: this.projectHistoryType
|
|
|
})
|
|
})
|
|
|
)
|
|
)
|
|
|
})
|
|
})
|