@@ -88,6 +88,10 @@ describe('Multiple document remove test', function() {
8888 content : {
8989 title : 'document 10'
9090 }
91+ } , {
92+ uri : 'test/remove/mult/doc11.xml' ,
93+ contentType : 'application/xml' ,
94+ content : '<title>document 11</title>'
9195 } ) .
9296 result ( function ( response ) { done ( ) ; } , done ) ;
9397 } ) ;
@@ -219,6 +223,53 @@ describe('Multiple document remove test', function() {
219223 } , done ) ;
220224 } ) ;
221225
226+ it ( 'should remove multiple documents with one invalid uri' , function ( done ) {
227+ dbWriter . documents . remove ( {
228+ uris : [
229+ '/test/remove/mult/doc8.json' ,
230+ '/test/remove/mult/invalidDoc.json' ,
231+ '/test/remove/mult/doc9.json'
232+ ]
233+ } ) .
234+ result ( function ( response ) {
235+ //console.log(response);
236+ return db . documents . probe ( '/test/remove/mult/doc8.json' ) . result ( ) ;
237+ } ) .
238+ then ( function ( response ) {
239+ response . exists . should . eql ( false ) ;
240+ //console.log(response);
241+ return db . documents . probe ( '/test/remove/mult/doc9.json' ) . result ( ) ;
242+ } ) .
243+ then ( function ( response ) {
244+ response . exists . should . eql ( false ) ;
245+ //console.log(response);
246+ done ( ) ;
247+ } , done ) ;
248+ } ) ;
249+
250+ it ( 'should remove multiple documents with different content type' , function ( done ) {
251+ dbWriter . documents . remove ( {
252+ uris : [
253+ '/test/remove/mult/doc10.json' ,
254+ '/test/remove/mult/doc11.xml'
255+ ]
256+ } ) .
257+ result ( function ( response ) {
258+ //console.log(response);
259+ return db . documents . probe ( '/test/remove/mult/doc10.json' ) . result ( ) ;
260+ } ) .
261+ then ( function ( response ) {
262+ response . exists . should . eql ( false ) ;
263+ //console.log(response);
264+ return db . documents . probe ( '/test/remove/mult/doc11.xml' ) . result ( ) ;
265+ } ) .
266+ then ( function ( response ) {
267+ response . exists . should . eql ( false ) ;
268+ //console.log(response);
269+ done ( ) ;
270+ } , done ) ;
271+ } ) ;
272+
222273 it ( 'should remove the directory' , function ( done ) {
223274 this . timeout ( 10000 ) ;
224275 dbWriter . documents . removeAll ( { directory :'/test/remove/mult' } ) .
0 commit comments