Add unit test for get posts command