feat: add integration tests for signup, login, reset_password, forgot_password, verify_email

This commit is contained in:
Lakhan Samani
2021-12-23 10:31:52 +05:30
parent 969395ccdb
commit beae4502d4
33 changed files with 722 additions and 152 deletions

View File

@@ -65,6 +65,13 @@ func initMongodb() (*mongo.Database, error) {
}, options.CreateIndexes())
mongodb.CreateCollection(ctx, Collections.Session, options.CreateCollection())
sessionCollection := mongodb.Collection(Collections.Session, options.Collection())
sessionCollection.Indexes().CreateMany(ctx, []mongo.IndexModel{
mongo.IndexModel{
Keys: bson.M{"user_id": 1},
Options: options.Index().SetSparse(true),
},
}, options.CreateIndexes())
return mongodb, nil
}