Skip to content

Instantly share code, notes, and snippets.

@mkonicek
Last active December 10, 2015 21:38
Show Gist options
  • Save mkonicek/4496644 to your computer and use it in GitHub Desktop.
Save mkonicek/4496644 to your computer and use it in GitHub Desktop.
class AuthenticationServiceSpec extends WordSpec with MustMatchers {
"authenticate" in {
val authService = new AuthenticationService(new Mongo())
val user = User("Jack", "[email protected]")
authService.signup(user, password = "24") must be (Success(user))
authService.login(user.email, "24") must be (Success(user))
authService.login(user.email, "25") must be (Failure("Invalid username or password."))
authService.login("[email protected]", "24") must be (Failure("Invalid username or password."))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment