added controller and scope specs for frontend posts controller and model and refactored to scope method