Refactor tests for users routes