added tests for posts controller