@@ -559,6 +559,29 @@ describe('HTTP APIs', function () {
559559 . expect ( hasHeader ( 'acl' , suffixAcl ) )
560560 . expect ( 201 , done )
561561 } )
562+ it ( 'should create new resource even if body is empty' , function ( done ) {
563+ server . post ( '/post-tests/' )
564+ . set ( 'slug' , 'post-resource-empty' )
565+ . set ( 'content-type' , 'text/turtle' )
566+ . expect ( hasHeader ( 'describedBy' , suffixMeta ) )
567+ . expect ( hasHeader ( 'acl' , suffixAcl ) )
568+ . expect ( 'location' , / .* \. t t l / )
569+ . expect ( 201 , done )
570+ } )
571+ it ( 'should error with 415 if the body is empty and no content type is provided' , function ( done ) {
572+ server . post ( '/post-tests/' )
573+ . set ( 'slug' , 'post-resource-empty-fail' )
574+ . expect ( 415 , done )
575+ } )
576+ it ( 'should create a resource if parsable rdf is provided but with no content-type header' , function ( done ) {
577+ server . post ( '/post-tests/' )
578+ . set ( 'slug' , 'post-resource-rdf-no-content-type' )
579+ . send ( postRequest1Body )
580+ . expect ( hasHeader ( 'describedBy' , suffixMeta ) )
581+ . expect ( hasHeader ( 'acl' , suffixAcl ) )
582+ . expect ( 'location' , '/post-tests/post-resource-rdf-no-content-type' )
583+ . expect ( 201 , done )
584+ } )
562585 it ( 'should create new resource even if no trailing / is in the target' ,
563586 function ( done ) {
564587 server . post ( '' )
0 commit comments