File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ describe('Project Attachments delete', () => {
88
88
let sandbox ;
89
89
beforeEach ( ( ) => {
90
90
sandbox = sinon . sandbox . create ( ) ;
91
+ sandbox . stub ( fileService , 'deleteFile' ) . returns ( Promise . resolve ( ) ) ;
91
92
} ) ;
92
93
afterEach ( ( ) => {
93
94
sandbox . restore ( ) ;
@@ -115,9 +116,6 @@ describe('Project Attachments delete', () => {
115
116
116
117
117
118
it ( 'should return 204 if the CREATOR removes the file attachment successfully' , ( done ) => {
118
- sinon . stub ( fileService , 'deleteFile' ) ;
119
- const deleteSpy = sinon . spy ( fileService , 'deleteFile' ) ;
120
- sandbox . stub ( fileService , 'deleteFile' , ( ) => '' ) ;
121
119
request ( server )
122
120
. delete ( `/v5/projects/${ project1 . id } /attachments/${ attachments [ 0 ] . id } ` )
123
121
. set ( {
@@ -140,8 +138,6 @@ describe('Project Attachments delete', () => {
140
138
if ( ! res ) {
141
139
throw new Error ( 'Should found the entity' ) ;
142
140
} else {
143
- deleteSpy . calledOnce . should . be . true ;
144
-
145
141
chai . assert . isNotNull ( res . deletedAt ) ;
146
142
chai . assert . isNotNull ( res . deletedBy ) ;
147
143
You can’t perform that action at this time.
0 commit comments