Improve tests for User.authenticate