@@ -6,8 +6,9 @@ const MongoClient = require('mongodb').MongoClient;
66describe ( 'MongoStorageAdapter' , ( ) => {
77 it ( 'auto-escapes symbols in auth information' , ( ) => {
88 spyOn ( MongoClient , 'connect' ) . and . returnValue ( Promise . resolve ( null ) ) ;
9- new MongoStorageAdapter ( 'mongodb://user!with@+ symbols:password!with@+ symbols@localhost:1234/parse' , { } )
10- . connect ( ) ;
9+ new MongoStorageAdapter ( {
10+ uri : 'mongodb://user!with@+ symbols:password!with@+ symbols@localhost:1234/parse'
11+ } ) . connect ( ) ;
1112 expect ( MongoClient . connect ) . toHaveBeenCalledWith (
1213 'mongodb://user!with%40%2B%20symbols:password!with%40%2B%20symbols@localhost:1234/parse' ,
1314 jasmine . any ( Object )
@@ -16,8 +17,9 @@ describe('MongoStorageAdapter', () => {
1617
1718 it ( "doesn't double escape already URI-encoded information" , ( ) => {
1819 spyOn ( MongoClient , 'connect' ) . and . returnValue ( Promise . resolve ( null ) ) ;
19- new MongoStorageAdapter ( 'mongodb://user!with%40%2B%20symbols:password!with%40%2B%20symbols@localhost:1234/parse' , { } )
20- . connect ( ) ;
20+ new MongoStorageAdapter ( {
21+ uri : 'mongodb://user!with%40%2B%20symbols:password!with%40%2B%20symbols@localhost:1234/parse'
22+ } ) . connect ( ) ;
2123 expect ( MongoClient . connect ) . toHaveBeenCalledWith (
2224 'mongodb://user!with%40%2B%20symbols:password!with%40%2B%20symbols@localhost:1234/parse' ,
2325 jasmine . any ( Object )
@@ -27,8 +29,9 @@ describe('MongoStorageAdapter', () => {
2729 // https://github.com/ParsePlatform/parse-server/pull/148#issuecomment-180407057
2830 it ( 'preserves replica sets' , ( ) => {
2931 spyOn ( MongoClient , 'connect' ) . and . returnValue ( Promise . resolve ( null ) ) ;
30- new MongoStorageAdapter ( 'mongodb://test:[email protected] :59325,ds059315-a1.mongolab.com:59315/testDBname?replicaSet=rs-ds059415' , { } ) 31- . connect ( ) ;
32+ new MongoStorageAdapter ( {
33+ uri :
'mongodb://test:[email protected] :59325,ds059315-a1.mongolab.com:59315/testDBname?replicaSet=rs-ds059415' 34+ } ) . connect ( ) ;
3235 expect ( MongoClient . connect ) . toHaveBeenCalledWith (
3336 'mongodb://test:[email protected] :59325,ds059315-a1.mongolab.com:59315/testDBname?replicaSet=rs-ds059415' , 3437 jasmine . any ( Object )
0 commit comments