Refactored UserTests to remove duplication.