modified the havePostInDatabase method to actually add a post in the database