@@ -6,8 +6,9 @@ const MongoClient = require('mongodb').MongoClient;
6
6
describe ( 'MongoStorageAdapter' , ( ) => {
7
7
it ( 'auto-escapes symbols in auth information' , ( ) => {
8
8
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 ( ) ;
11
12
expect ( MongoClient . connect ) . toHaveBeenCalledWith (
12
13
'mongodb://user!with%40%2B%20symbols:password!with%40%2B%20symbols@localhost:1234/parse' ,
13
14
jasmine . any ( Object )
@@ -16,8 +17,9 @@ describe('MongoStorageAdapter', () => {
16
17
17
18
it ( "doesn't double escape already URI-encoded information" , ( ) => {
18
19
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 ( ) ;
21
23
expect ( MongoClient . connect ) . toHaveBeenCalledWith (
22
24
'mongodb://user!with%40%2B%20symbols:password!with%40%2B%20symbols@localhost:1234/parse' ,
23
25
jasmine . any ( Object )
@@ -27,8 +29,9 @@ describe('MongoStorageAdapter', () => {
27
29
// https://github.com/ParsePlatform/parse-server/pull/148#issuecomment-180407057
28
30
it ( 'preserves replica sets' , ( ) => {
29
31
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 ( ) ;
32
35
expect ( MongoClient . connect ) . toHaveBeenCalledWith (
33
36
'mongodb://test:[email protected] :59325,ds059315-a1.mongolab.com:59315/testDBname?replicaSet=rs-ds059415' ,
34
37
jasmine . any ( Object )
0 commit comments