refactored post controller, with spec