test successful publish, refactor publish_test