Refactoring of auth tests