added test and change db.yaml to use postgres