refactor test to have one method to do the posting