@@ -18,6 +18,8 @@ debug('replay localhosts', replay._localhosts);
1818 \"TLS server: In state wait_finished received CLIENT ALERT: Fatal - Certificate Unknown\\n\"}}}"
1919 */
2020let destination = 'http://admin:none@localhost:5984' ;
21+ const couchUrl = destination . replace ( 'admin:none@' , '' ) ;
22+
2123if ( ! destination ) {
2224 destination = url . parse ( config . usersDbConnection . url ) ;
2325 destination . auth = `${ config . couchKeys . username } :${ config . couchKeys . password } ` ;
@@ -525,19 +527,39 @@ describe('install', () => {
525527 expect ( res . body . ok ) . to . equal ( true ) ;
526528
527529 return supertest ( destination )
530+ . put ( `/${ dbnameToReplicate } /_security` )
531+ . set ( 'cookie' , adminSessionCookie )
532+ . set ( 'Accept' , 'application/json' )
533+ . send ( {
534+ // The couchapp is public but only admins can write to it
535+ members : { roles : [ ] } ,
536+ admins : { roles : [ "_admin" ] } ,
537+ } ) ;
538+ } )
539+ . then ( ( res ) => {
540+ expect ( res . body . ok ) . to . equal ( true ) ;
541+
542+ return supertest ( couchUrl )
528543 . get ( `/${ dbnameToReplicate } /_design/prototype` )
529544 . set ( 'Accept' , 'application/json' ) ;
530545 } )
531546 . then ( ( res ) => {
532547 debug ( 'res.body prototype after ' , res . body ) ;
533548 expect ( res . body . couchapp && res . body . couchapp . name ) . to . contain ( 'Prototype (has the most features of the apps)' , JSON . stringify ( res . body ) ) ;
534549
535- return supertest ( destination )
550+ return supertest ( couchUrl )
536551 . get ( `/${ dbnameToReplicate } /_design/prototype/user.html` ) ;
537552 } )
538553 . then ( ( res ) => {
539554 debug ( 'res.body prototype after ' , res . body ) ;
540555 expect ( res . status ) . to . equal ( 200 ) ;
556+
557+ return supertest ( couchUrl )
558+ . get ( `/${ dbnameToReplicate } /_design/prototype/app/app.css` ) ;
559+ } )
560+ . then ( ( res ) => {
561+ debug ( 'attachments prototype after ' , res . body ) ;
562+ expect ( res . status ) . to . equal ( 200 ) ;
541563 } ) ;
542564 } ) ;
543565 } ) ;
0 commit comments