Skip to content

Commit

Permalink
to fix disabling account test
Browse files Browse the repository at this point in the history
  • Loading branch information
fupelaqu committed Nov 10, 2023
1 parent 05ec895 commit 93383e3
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ trait AccountRouteSpec[
}

"oauth" should {
"should generate authorization code with matching username and password" in {
"generate authorization code with matching username and password" in {
val validCredentials = BasicHttpCredentials(username, password)
Get(
s"/$RootPath/${AccountSettings.OAuthPath}/authorize?response_type=code&client_id=test"
Expand All @@ -191,7 +191,7 @@ trait AccountRouteSpec[
authorizationCode should not be empty
}
}
"should generate access token with matching authorization code" in {
"generate access token with matching authorization code" in {
Post(
s"/$RootPath/${AccountSettings.OAuthPath}/token",
FormData(
Expand All @@ -209,7 +209,7 @@ trait AccountRouteSpec[
refreshToken should not be empty
}
}
"should refresh access token" in {
"refresh access token" in {
Post(
s"/$RootPath/${AccountSettings.OAuthPath}/token",
FormData(
Expand All @@ -229,7 +229,7 @@ trait AccountRouteSpec[
refreshToken = refreshToken2
}
}
"should retrieve me with matching bearer access token" in {
"retrieve me with matching bearer access token" in {
implicit val manifest: Manifest[AV] = manifestWrapper.wrapped
Get(
s"/$RootPath/${AccountSettings.OAuthPath}/me"
Expand Down Expand Up @@ -333,7 +333,12 @@ trait AccountRouteSpec[
Login(gsm, password)
) ~> routes // reset number of failures
(0 until AccountSettings.MaxLoginFailures) // max number of failures
.map(_ => Post(s"/$RootPath/${AccountSettings.Path}/login", Login(gsm, "fake")) ~> routes)
.map(_ =>
Post(s"/$RootPath/${AccountSettings.Path}/login", Login(gsm, "fake")) ~> routes ~> check {
status shouldEqual StatusCodes.Unauthorized
responseAs[AccountErrorMessage].message shouldEqual LoginAndPasswordNotMatched.message
}
)
Post(s"/$RootPath/${AccountSettings.Path}/login", Login(gsm, "fake")) ~> routes ~> check {
status shouldEqual StatusCodes.Unauthorized
responseAs[AccountErrorMessage].message shouldEqual AccountDisabled.message
Expand Down

0 comments on commit 93383e3

Please sign in to comment.