File tree 2 files changed +21
-3
lines changed
2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -290,10 +290,9 @@ router.put(
290
290
router . delete (
291
291
PATH_SINGLE ,
292
292
deleteFor ( {
293
- soft : true ,
294
293
del : ( options , done ) => {
295
294
const { File } = createModels ( ) ;
296
- return File . del ( options , done ) ;
295
+ return File . unlink ( get ( options , '_id' ) , done ) ;
297
296
} ,
298
297
} )
299
298
) ;
Original file line number Diff line number Diff line change @@ -93,7 +93,26 @@ describe('HTTP API', () => {
93
93
94
94
it . skip ( 'should handle HTTP PATCH on /files/:bucket/:id' , done => done ( ) ) ;
95
95
it . skip ( 'should handle HTTP PUT on /files/:bucket/:id' , done => done ( ) ) ;
96
- it . skip ( 'should handle HTTP DELETE on /files/:bucket/:id' , done => done ( ) ) ;
96
+
97
+ it ( 'should handle HTTP DELETE on /files/:bucket/:id' , done => {
98
+ const { testDelete } = testRouter ( options , fileRouter ) ;
99
+ const params = { bucket : 'files' , id : file . _id } ;
100
+ testDelete ( params )
101
+ . expect ( 'Content-Type' , / j s o n / )
102
+ . expect ( 200 , ( error , { body } ) => {
103
+ console . log ( body ) ;
104
+ expect ( error ) . to . not . exist ;
105
+ expect ( body ) . to . exist ;
106
+ expect ( body . _id ) . to . exist . and . be . eql ( file . _id ) ;
107
+ expect ( body . filename ) . to . exist . and . be . eql ( file . filename ) ;
108
+ expect ( body . contentType ) . to . exist . and . be . eql ( file . contentType ) ;
109
+ expect ( body . length ) . to . exist . and . be . eql ( file . length ) ;
110
+ expect ( body . chunkSize ) . to . exist . and . be . eql ( file . chunkSize ) ;
111
+ expect ( body . uploadDate ) . to . exist . and . be . eql ( file . uploadDate ) ;
112
+ expect ( body . md5 ) . to . exist . and . be . eql ( file . md5 ) ;
113
+ done ( error , body ) ;
114
+ } ) ;
115
+ } ) ;
97
116
98
117
after ( ( ) => clearHttp ( ) ) ;
99
118
after ( done => clearDatabase ( done ) ) ;
You can’t perform that action at this time.
0 commit comments