refactor tests for user model