Adding publish scenario tests

Adding publish scenario tests, also fix #1153 also #1150