@@ -160,7 +160,7 @@ describe('install', () => {
160160 } ) ;
161161
162162 describe ( 'new_testing_corpus' , ( ) => {
163- it . only ( 'should replicate new_testing_corpus' , ( ) => {
163+ it ( 'should replicate new_testing_corpus' , ( ) => {
164164 const dbnameToReplicate = 'new_testing_corpus' ;
165165
166166 return supertest ( destination )
@@ -192,11 +192,45 @@ describe('install', () => {
192192 } )
193193 . then ( ( res ) => {
194194 debug ( 'res.body new_testing_corpus design doc for data' , res . body ) ;
195- // FIXME: this design doc throws an error in CouchDB 3.x
196- // expect(res.body).to.deep.equal({
197- // rows: [],
198- // }, JSON.stringify(res.body));
199- expect ( res . body . reason ) . to . equal ( 'missing' , JSON . stringify ( res . body ) ) ;
195+ expect ( res . body ) . to . deep . equal ( {
196+ rows : [ ] ,
197+ } , JSON . stringify ( res . body ) ) ;
198+ } ) ;
199+ } ) ;
200+
201+ it ( 'should replicate the prototype couchapp' , ( ) => {
202+ const dbnameToReplicate = 'prototype' ;
203+
204+ return supertest ( destination )
205+ . post ( '/_replicate' )
206+ . set ( 'cookie' , adminSessionCookie )
207+ . set ( 'Accept' , 'application/json' )
208+ . send ( {
209+ source : `${ source } /${ dbnameToReplicate } ` ,
210+ target : {
211+ url : `${ destination } /${ dbnameToReplicate } ` ,
212+ } ,
213+ create_target : true ,
214+ } )
215+ . then ( ( res ) => {
216+ debug ( 'res.body prototype' , res . body ) ;
217+ expect ( res . body . ok ) . to . equal ( true ) ;
218+
219+ return supertest ( destination )
220+ . get ( '/_all_dbs' )
221+ . set ( 'Accept' , 'application/json' ) ;
222+ } )
223+ . then ( ( res ) => {
224+ debug ( 'res.body prototype after' , res . body ) ;
225+ expect ( res . body ) . includes ( dbnameToReplicate ) ;
226+
227+ return supertest ( destination )
228+ . get ( `/${ dbnameToReplicate } /_design/prototype` )
229+ . set ( 'Accept' , 'application/json' ) ;
230+ } )
231+ . then ( ( res ) => {
232+ debug ( 'res.body prototype couchapp' , res . body ) ;
233+ expect ( res . body . couchapp . name ) . to . equal ( ' Prototype (has the most features of the apps)' , JSON . stringify ( res . body ) ) ;
200234 } ) ;
201235 } ) ;
202236 } ) ;
0 commit comments