File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -288,6 +288,35 @@ describe('HTTP APIs', function () {
288288 server . delete ( '/put-resource-1.ttl' )
289289 . expect ( 200 , done )
290290 } )
291+ it ( 'should fail to delete non-empty containers' , function ( done ) {
292+ server . put ( '/fooo/bar.ttl' )
293+ . set ( 'content-type' , 'text/turtle' )
294+ . expect ( function ( ) {
295+ server . delete ( '/fooo/' )
296+ . expect ( function ( ) {
297+ fs . unlinkSync ( __dirname + '/resources/fooo/bar.ttl' )
298+ fs . rmdirSync ( __dirname + '/resources/fooo/' )
299+ } )
300+ . expect ( 409 )
301+ } )
302+ . expect ( 201 , done )
303+ } )
304+ it ( 'should delete a new and empty container' , function ( done ) {
305+ server . post ( '/' )
306+ . set ( 'content-type' , 'text/turtle' )
307+ . set ( 'slug' , 'fooo' )
308+ . set ( 'link' , '<http://www.w3.org/ns/ldp#BasicContainer>; rel="type"' )
309+ . set ( 'content-type' , 'text/turtle' )
310+ . expect ( function ( ) {
311+ server . delete ( '/fooo/' )
312+ . expect ( function ( ) {
313+ server . get ( '/fooo/' )
314+ . expect ( 404 )
315+ } )
316+ . expect ( 200 )
317+ } )
318+ . expect ( 201 , done )
319+ } )
291320 } )
292321
293322 describe ( 'POST API' , function ( ) {
You can’t perform that action at this time.
0 commit comments