Refactors login test