Added login tests and code to pass them