Unit test for auto-publish

LMS-11017