public
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
"retrieve a user by UserId" in {
 
val app = new FakeApplication()
 
running(app) {
 
val myUserService = new MyUserService(app)
 
val user : Option[User] = myUserService.find(UserId("johnnyboy", "userpass"))
 
val getUser = user.get
 
getUser.uid must equalTo(Some(1))
getUser.id.id must equalTo ("johnnyboy")
getUser.id.providerId must equalTo("userpass")
getUser.userType must equalTo(Some("admin"))
getUser.firstName must equalTo("John")
getUser.lastName must equalTo("Smith")
getUser.fullName must equalTo("John Smith")
getUser.email must equalTo(Some("johnsmith@gmail.com"))
getUser.avatarUrl must equalTo(None)
getUser.authMethod must equalTo(AuthenticationMethod("userPassword"))
getUser.oAuth1Info must equalTo(None)
getUser.oAuth2Info must equalTo(None)
getUser.passwordInfo.get.hasher must equalTo(PasswordHasher.BCryptHasher)
getUser.passwordInfo.get.password must equalTo("$2a$10$eYPUTBSjprjKKmUf4m4XRuwurSxKKwbw13eP6WyDNk/LdpKgBytda")
getUser.passwordInfo.get.salt must equalTo(None)
 
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.