@@ -10,7 +10,7 @@ describe('ReadConcern', function() {
1010 return setupDatabase ( configuration ) ;
1111 } ) ;
1212
13- it ( 'Should set local readConcern on db level' , {
13+ it ( 'Should set local readConcern on db level when using collection method ' , {
1414 metadata : { requires : { topology : 'replicaset' , mongodb : '>= 3.2' } } ,
1515
1616 test : function ( done ) {
@@ -56,6 +56,31 @@ describe('ReadConcern', function() {
5656 }
5757 } ) ;
5858
59+ it ( 'Should set local readConcern on db level when using createCollection method' , {
60+ metadata : { requires : { topology : 'replicaset' , mongodb : '>= 3.2' } } ,
61+
62+ test : function ( done ) {
63+ // Get a new instance
64+ const configuration = this . configuration ;
65+ const client = configuration . newClient (
66+ { w : 1 } ,
67+ { poolSize : 1 , readConcern : { level : 'local' } }
68+ ) ;
69+ client . connect ( ( err , client ) => {
70+ expect ( err ) . to . not . exist ;
71+ const db = client . db ( configuration . db ) ;
72+ expect ( db . s . readConcern ) . to . deep . equal ( { level : 'local' } ) ;
73+
74+ // Get a collection using createCollection
75+ db . createCollection ( 'readConcernCollection' , ( err , collection ) => {
76+ // Validate readConcern
77+ expect ( collection . s . readConcern ) . to . deep . equal ( { level : 'local' } ) ;
78+ client . close ( done ) ;
79+ } ) ;
80+ } ) ;
81+ }
82+ } ) ;
83+
5984 it ( 'Should set majority readConcern on db level' , {
6085 metadata : { requires : { topology : 'replicaset' , mongodb : '>= 3.2' } } ,
6186
0 commit comments